@enso-ui/tutorials 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 laravel-enso
3
+ Copyright (c) 2026 laravel-enso
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -26,4 +26,4 @@ Thank you to all the people who already contributed to Enso!
26
26
 
27
27
  ## License
28
28
 
29
- [ISC](https://opensource.org/licenses/ISC)
29
+ [MIT](https://opensource.org/licenses/MIT)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/tutorials",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Basic tutorials package",
5
5
  "main": "src/bulma/pages/tutorials/Index.vue",
6
6
  "scripts": {
@@ -15,31 +15,20 @@
15
15
  "vue"
16
16
  ],
17
17
  "author": "Adrian Ocneanu <aocneanu@gmail.com>",
18
- "license": "ISC",
18
+ "license": "MIT",
19
19
  "bugs": {
20
20
  "url": "https://github.com/enso-ui/tutorials/issues"
21
21
  },
22
22
  "homepage": "https://github.com/enso-ui/tutorials#readme",
23
23
  "dependencies": {
24
- "@enso-ui/forms": "^3.0",
25
- "@enso-ui/tables": "^3.0",
26
- "@enso-ui/ui": "^6.0",
27
- "@fortawesome/fontawesome-svg-core": "^1.2.2",
28
- "@fortawesome/free-solid-svg-icons": "^5.11.2",
29
- "@fortawesome/free-brands-svg-icons": "^5.11.2",
30
- "@fortawesome/vue-fontawesome": "3.0.0-5",
24
+ "@enso-ui/forms": "^4.0.0",
25
+ "@enso-ui/tables": "^4.0.0",
26
+ "@enso-ui/ui": "^7.0.0",
27
+ "@fortawesome/fontawesome-svg-core": "^7.2.0",
28
+ "@fortawesome/free-solid-svg-icons": "^7.2.0",
29
+ "@fortawesome/vue-fontawesome": "3.1.3",
31
30
  "driver.js": "^0.9.8",
32
- "vue": "^3.0",
33
- "vuex": "^4.0.0"
34
- },
35
- "devDependencies": {
36
- "@vue/cli-plugin-babel": "5.0.0-beta.6",
37
- "@vue/cli-plugin-eslint": "5.0.0-beta.6",
38
- "@vue/eslint-config-airbnb": "^5.0.0",
39
- "autoprefixer": "^9.6.1",
40
- "babel-eslint": "^10.0.1",
41
- "eslint-plugin-vue": "^8.0.0",
42
- "eslint": "^7.0.0",
43
- "eslint-import-resolver-alias": "^1.1.2"
31
+ "pinia": "^3.0.3",
32
+ "vue": "^3.0"
44
33
  }
45
34
  }
@@ -1,18 +1,18 @@
1
1
  <template>
2
- <div class="level is-mobile">
2
+ <div class="level is-mobile tutorial-setting">
3
3
  <div class="level-left">
4
- <div class="level-item">
4
+ <div class="level-item m-0 is-flex is-align-items-center">
5
5
  {{ i18n('Tutorial') }}
6
6
  </div>
7
7
  </div>
8
8
  <div class="level-right">
9
- <div class="level-item">
9
+ <div class="level-item m-0 is-flex is-align-items-center">
10
10
  <core-tutorial>
11
11
  <template #default="{ itemEvents }">
12
- <a class="button is-naked"
12
+ <a class="button is-small is-naked p-0 is-flex is-align-items-center is-justify-content-center"
13
13
  v-on="itemEvents">
14
- <span class="icon is-small">
15
- <fa icon="question"/>
14
+ <span class="icon is-small m-0 is-flex is-align-items-center is-justify-content-center">
15
+ <fa :icon="faQuestion"/>
16
16
  </span>
17
17
  </a>
18
18
  </template>
@@ -24,21 +24,26 @@
24
24
 
25
25
  <script>
26
26
  import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
27
- import { library } from '@fortawesome/fontawesome-svg-core';
28
27
  import { faQuestion } from '@fortawesome/free-solid-svg-icons';
29
28
  import CoreTutorial from '../../../core/components/settings/Tutorial.vue';
30
29
 
31
- library.add(faQuestion);
32
-
33
30
  export default {
34
31
  name: 'Tutorial',
35
32
 
36
33
  components: { CoreTutorial, Fa },
37
34
 
38
35
  inject: ['i18n'],
36
+
37
+ data: () => ({
38
+ faQuestion,
39
+ }),
39
40
  };
40
41
  </script>
41
42
 
42
43
  <style lang="scss">
43
- @import '~driver.js/dist/driver.min.css';
44
+ @import 'driver.js/dist/driver.min.css';
45
+
46
+ .tutorial-setting .svg-inline--fa {
47
+ vertical-align: 0;
48
+ }
44
49
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="columns is-centered">
3
3
  <div class="column is-three-quarters-desktop is-full-touch">
4
- <enso-form class="box has-background-light raises-on-hover"/>
4
+ <enso-form class="box"/>
5
5
  </div>
6
6
  </div>
7
7
  </template>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="columns is-centered">
3
3
  <div class="column is-three-quarters-desktop is-full-touch">
4
- <enso-form class="box has-background-light raises-on-hover"/>
4
+ <enso-form class="box"/>
5
5
  </div>
6
6
  </div>
7
7
  </template>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <enso-table class="box is-paddingless raises-on-hover"
2
+ <enso-table class="box p-0"
3
3
  id="tutorials">
4
4
  <template #placement="{ column, row }">
5
- <span class="tag is-table-tag is-info">
5
+ <span class="tag is-info">
6
6
  {{ column.enum._get(row.placement) }}
7
7
  </span>
8
8
  </template>
@@ -1,4 +1,5 @@
1
- import App from '@enso-ui/ui/src/core/app';
2
1
  import Tutorial from './components/settings/Tutorial.vue';
3
2
 
4
- App.registerSettingsItem('tutorials', Tutorial, 350);
3
+ export default App => {
4
+ App.registerSettingsItem('tutorials', Tutorial, 350);
5
+ };
@@ -1,6 +1,6 @@
1
1
  import routeImporter from '@enso-ui/ui/src/modules/importers/routeImporter';
2
2
 
3
- const routes = routeImporter(require.context('./tutorials', false, /.*\.js$/));
3
+ const routes = routeImporter.fromGlob(import.meta.glob('./tutorials/*.js', { eager: true }));
4
4
  const Router = () => import('@enso-ui/ui/src/bulma/pages/Router.vue');
5
5
 
6
6
  export default {
@@ -1,6 +1,6 @@
1
1
  import routeImporter from '@enso-ui/ui/src/modules/importers/routeImporter';
2
2
 
3
- const routes = routeImporter(require.context('./system', false, /.*\.js$/));
3
+ const routes = routeImporter.fromGlob(import.meta.glob('./system/*.js', { eager: true }));
4
4
 
5
5
  export default {
6
6
  path: '/system',
@@ -1,6 +1,15 @@
1
1
  <script>
2
- import { mapMutations } from 'vuex';
3
- import Driver from 'driver.js';
2
+ import { getActivePinia } from 'pinia';
3
+
4
+ const useStore = id => {
5
+ const store = getActivePinia()?._s?.get(id);
6
+
7
+ if (!store) {
8
+ throw new Error(`Missing Pinia store: ${id}`);
9
+ }
10
+
11
+ return store;
12
+ };
4
13
 
5
14
  export default {
6
15
  name: 'Tutorial',
@@ -19,19 +28,35 @@ export default {
19
28
  },
20
29
  },
21
30
 
22
- data: v => ({
23
- driver: new Driver({
24
- animate: false,
25
- doneBtnText: v.i18n(v.labels.done),
26
- closeBtnText: v.i18n(v.labels.close),
27
- nextBtnText: v.i18n(v.labels.next),
28
- prevBtnText: v.i18n(v.labels.previous),
29
- }),
31
+ data: () => ({
32
+ driver: null,
30
33
  }),
31
34
 
32
35
  methods: {
33
- ...mapMutations('layout/settings', { toggleSettingsBar: 'toggle' }),
34
- fetch() {
36
+ async resolveDriver() {
37
+ if (this.driver) {
38
+ return this.driver;
39
+ }
40
+
41
+ const module = await import('driver.js');
42
+ const Driver = module.default?.default
43
+ ?? module.default
44
+ ?? module.Driver
45
+ ?? module;
46
+
47
+ this.driver = new Driver({
48
+ animate: false,
49
+ doneBtnText: this.i18n(this.labels.done),
50
+ closeBtnText: this.i18n(this.labels.close),
51
+ nextBtnText: this.i18n(this.labels.next),
52
+ prevBtnText: this.i18n(this.labels.previous),
53
+ });
54
+
55
+ return this.driver;
56
+ },
57
+ async fetch() {
58
+ await this.resolveDriver();
59
+
35
60
  this.http.get(this.route('system.tutorials.load'), {
36
61
  params: { route: this.$route.name },
37
62
  }).then(({ data }) => this.start(data))
@@ -42,7 +67,7 @@ export default {
42
67
  return;
43
68
  }
44
69
 
45
- this.toggleSettingsBar();
70
+ useStore('layout').toggleSettings();
46
71
  this.driver.defineSteps(this.localise(steps));
47
72
  this.driver.start();
48
73
  },