Skip to content

Commit e8cd5fb

Browse files
committed
First commit
0 parents  commit e8cd5fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+6404
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.{diff,md}]
16+
trim_trailing_whitespace = false
17+
18+
[*.{php,xml,json}]
19+
indent_size = 4

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**/.gitattributes export-ignore
2+
**/.gitignore export-ignore
3+
**/.gitmodules export-ignore
4+
**/.github export-ignore
5+
**/.travis export-ignore
6+
**/.travis.yml export-ignore
7+
**/.editorconfig export-ignore
8+
**/.styleci.yml export-ignore
9+
10+
**/phpunit.xml export-ignore
11+
**/tests export-ignore
12+
13+
**/js/dist/**/* -diff
14+
**/js/dist/**/* linguist-generated
15+
**/js/dist-typings/**/* -diff
16+
**/js/dist-typings/**/* linguist-generated
17+
**/js/yarn.lock -diff
18+
**/js/package-lock.json -diff
19+
20+
* text=auto eol=lf

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: datlechin

.github/workflows/backend.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Simple Tour Guide PHP
2+
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
jobs:
6+
run:
7+
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main
8+
with:
9+
enable_backend_testing: false
10+
11+
backend_directory: .

.github/workflows/frontend.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Simple Tour Guide JS
2+
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
jobs:
6+
run:
7+
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@main
8+
with:
9+
enable_bundlewatch: false
10+
enable_prettier: true
11+
enable_typescript: true
12+
13+
frontend_directory: ./js
14+
backend_directory: .
15+
js_package_manager: npm
16+
main_git_branch: main
17+
secrets:
18+
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
5+
.DS_Store
6+
Thumbs.db
7+
tests/.phpunit.result.cache
8+
/tests/integration/tmp
9+
.vagrant
10+
.idea/*
11+
.vscode
12+
js/coverage-ts

.styleci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
preset: recommended
2+
3+
enabled:
4+
- logical_not_operators_with_successor_space
5+
6+
disabled:
7+
- align_double_arrow
8+
- blank_line_after_opening_tag
9+
- multiline_array_trailing_comma
10+
- new_with_braces
11+
- phpdoc_align
12+
- phpdoc_order
13+
- phpdoc_separation
14+
- phpdoc_types

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) <year> <copyright holders>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Simple Tour Guide
2+
3+
![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/datlechin/flarum-simple-tour-guide.svg)](https://packagist.org/packages/datlechin/flarum-simple-tour-guide) [![Total Downloads](https://img.shields.io/packagist/dt/datlechin/flarum-simple-tour-guide.svg)](https://packagist.org/packages/datlechin/flarum-simple-tour-guide)
4+
5+
The **Simple Tour Guide** extension offers an intuitive way to introduce users to your forum's features, providing a step-by-step tour to enhance their understanding and engagement.
6+
7+
![Simple Tour Guide](https://github.com/datlechin/flarum-simple-tour-guide/assets/56961917/fc3fdce5-bc32-4028-a22e-c48818b7a05c)
8+
![Simple Tour Guide](https://github.com/datlechin/flarum-simple-tour-guide/assets/56961917/7548a2ee-d718-48d6-9e9c-0cb373653087)
9+
10+
## Key Features
11+
12+
- **Interactive Tour**: Seamlessly guides users through essential forum functionalities.
13+
- **Onboarding Support**: Simplifies the onboarding process for new users, helping them familiarize themselves with the platform quickly.
14+
- **Customizable Steps**: Tailor the tour to highlight unique features and sections of your forum.
15+
- **Engagement Boost**: Encourages user interaction and participation within the community.
16+
17+
![Admin](https://github.com/datlechin/flarum-simple-tour-guide/assets/56961917/6ac91249-5d0e-4457-998e-d9711757e32f)
18+
![Admin](https://github.com/datlechin/flarum-simple-tour-guide/assets/56961917/2e34da38-a4dc-4019-ad20-db6b3ef23258)
19+
20+
## Installation
21+
22+
Install with composer:
23+
24+
```sh
25+
composer require datlechin/flarum-simple-tour-guide:"*"
26+
```
27+
28+
## Updating
29+
30+
```sh
31+
composer update datlechin/flarum-simple-tour-guide:"*"
32+
php flarum migrate
33+
php flarum cache:clear
34+
```
35+
36+
## Links
37+
38+
- [Packagist](https://packagist.org/packages/datlechin/flarum-simple-tour-guide)
39+
- [GitHub](https://github.com/datlechin/flarum-simple-tour-guide)
40+
- [Discuss](https://discuss.flarum.org/d/33683)
41+
42+
## Support and Donation
43+
44+
If you find this extension helpful and would like to support its development, you can contribute by sponsoring this project: https://github.com/sponsors/datlechin
45+
46+
Your support is greatly appreciated and helps in further enhancing and maintaining this extension for the Flarum community.

composer.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "datlechin/flarum-simple-tour-guide",
3+
"description": "A simple tour guide for Flarum",
4+
"keywords": [
5+
"flarum",
6+
"extension",
7+
"tour guide",
8+
"simple tour guide"
9+
],
10+
"type": "flarum-extension",
11+
"license": "MIT",
12+
"require": {
13+
"flarum/core": "^1.2.0"
14+
},
15+
"authors": [
16+
{
17+
"name": "Ngo Quoc Dat",
18+
"email": "datlechin@gmail.com",
19+
"role": "Developer",
20+
"homepage": "https://ngoquocdat.dev"
21+
}
22+
],
23+
"support": {
24+
"source": "https://github.com/datlechin/flarum-simple-tour-guide",
25+
"forum": "https://discuss.flarum.org/d/33683"
26+
},
27+
"autoload": {
28+
"psr-4": {
29+
"Datlechin\\FlarumSimpleTourGuide\\": "src/"
30+
}
31+
},
32+
"extra": {
33+
"flarum-extension": {
34+
"title": "Simple Tour Guide",
35+
"category": "feature",
36+
"icon": {
37+
"name": "fas fa-map-signs",
38+
"color": "#fff",
39+
"backgroundColor": "#D3241C"
40+
}
41+
},
42+
"flarum-cli": {
43+
"modules": {
44+
"admin": true,
45+
"forum": true,
46+
"js": true,
47+
"jsCommon": true,
48+
"css": true,
49+
"locale": true,
50+
"gitConf": true,
51+
"githubActions": true,
52+
"prettier": true,
53+
"typescript": true,
54+
"bundlewatch": false,
55+
"backendTesting": false,
56+
"editorConfig": true,
57+
"styleci": true
58+
}
59+
}
60+
},
61+
"minimum-stability": "dev",
62+
"prefer-stable": true
63+
}

extend.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/*
4+
* This file is part of datlechin/flarum-simple-tour-guide.
5+
*
6+
* Copyright (c) 2023 Ngo Quoc Dat.
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Datlechin\FlarumSimpleTourGuide;
13+
14+
use Datlechin\FlarumSimpleTourGuide\Api\Controller\CreateTourGuideStepController;
15+
use Datlechin\FlarumSimpleTourGuide\Api\Controller\DeleteTourGuideStepController;
16+
use Datlechin\FlarumSimpleTourGuide\Api\Controller\DismissTourGuideController;
17+
use Datlechin\FlarumSimpleTourGuide\Api\Controller\ListTourGuideStepController;
18+
use Datlechin\FlarumSimpleTourGuide\Api\Controller\UpdateTourGuideStepController;
19+
use Flarum\Api\Serializer\UserSerializer;
20+
use Flarum\User\User;
21+
use Flarum\Extend;
22+
23+
return [
24+
(new Extend\Frontend('forum'))
25+
->js(__DIR__ . '/js/dist/forum.js')
26+
->css(__DIR__ . '/less/forum.less'),
27+
28+
(new Extend\Frontend('admin'))
29+
->js(__DIR__ . '/js/dist/admin.js')
30+
->css(__DIR__ . '/less/admin.less'),
31+
32+
new Extend\Locales(__DIR__ . '/locale'),
33+
34+
(new Extend\ApiSerializer(UserSerializer::class))
35+
->attribute(
36+
'tourGuideDismissedAt',
37+
fn(UserSerializer $serializer, User $model, array $attributes) => $model->tour_guide_dismissed_at
38+
),
39+
40+
(new Extend\Routes('api'))
41+
->get('/tour-guide-steps', 'tour-guide-steps.index', ListTourGuideStepController::class)
42+
->post('/tour-guide-steps', 'tour-guide-steps.create', CreateTourGuideStepController::class)
43+
->delete('/tour-guide-steps/{id}', 'tour-guide-steps.delete', DeleteTourGuideStepController::class)
44+
->patch('/tour-guide-steps/{id}', 'tour-guide-steps.update', UpdateTourGuideStepController::class)
45+
->post('/simple-tour-guide/dismiss', 'simple-tour-guide.dismiss', DismissTourGuideController::class),
46+
47+
(new Extend\Settings())
48+
->serializeToForum('datlechin-simple-tour-guide.showProgress', 'datlechin-simple-tour-guide.show_progress', 'boolval')
49+
->serializeToForum('datlechin-simple-tour-guide.allowDismiss', 'datlechin-simple-tour-guide.allow_dismiss', 'boolval')
50+
->serializeToForum('datlechin-simple-tour-guide.steps', 'datlechin-simple-tour-guide.steps')
51+
];

js/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.pnp.*
2+
.yarn/*
3+
!.yarn/patches
4+
!.yarn/plugins
5+
!.yarn/releases
6+
!.yarn/sdks
7+
!.yarn/versions
8+
9+
node_modules

js/admin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './src/common';
2+
export * from './src/admin';

js/forum.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './src/common';
2+
export * from './src/forum';

0 commit comments

Comments
 (0)