@creopse/bridge 0.1.0 → 0.1.1

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.
Files changed (82) hide show
  1. package/dist/index-BWhWXGj9.js +13 -0
  2. package/dist/react/bridge.js +27 -0
  3. package/dist/react/bridge10.js +24 -0
  4. package/dist/react/bridge11.js +32 -0
  5. package/dist/react/bridge12.js +23 -0
  6. package/dist/react/bridge13.js +18 -0
  7. package/dist/react/bridge2.js +66 -0
  8. package/dist/react/bridge3.js +37 -0
  9. package/dist/react/bridge4.js +20 -0
  10. package/dist/react/bridge5.js +54 -0
  11. package/dist/react/bridge6.js +54 -0
  12. package/dist/react/bridge7.js +70 -0
  13. package/dist/react/bridge8.js +54 -0
  14. package/dist/react/bridge9.js +37 -0
  15. package/dist/vite/index.js +6 -2
  16. package/dist/vite/react.js +131 -147
  17. package/dist/vite/vue.js +123 -138
  18. package/dist/vue/bridge.js +15 -0
  19. package/dist/vue/bridge2.js +27 -0
  20. package/dist/vue/bridge3.js +1 -0
  21. package/dist/vue/bridge4.js +18 -0
  22. package/dist/vue/bridge5.js +1 -0
  23. package/dist/vue/bridge6.js +41 -0
  24. package/dist/vue/bridge7.js +16 -0
  25. package/package.json +38 -12
  26. package/dist/react/components/AsyncImg/AsyncImg.d.ts +0 -12
  27. package/dist/react/components/AsyncImg/AsyncImg.js +0 -20
  28. package/dist/react/components/AsyncImg/index.d.ts +0 -1
  29. package/dist/react/components/AsyncImg/index.js +0 -1
  30. package/dist/react/components/CustomTransition/CustomTransition.d.ts +0 -12
  31. package/dist/react/components/CustomTransition/CustomTransition.js +0 -48
  32. package/dist/react/components/CustomTransition/index.d.ts +0 -1
  33. package/dist/react/components/CustomTransition/index.js +0 -1
  34. package/dist/react/components/Image/Image.d.ts +0 -14
  35. package/dist/react/components/Image/Image.js +0 -20
  36. package/dist/react/components/Image/index.d.ts +0 -1
  37. package/dist/react/components/Image/index.js +0 -1
  38. package/dist/react/components/MountedTeleport/MountedTeleport.d.ts +0 -8
  39. package/dist/react/components/MountedTeleport/MountedTeleport.js +0 -43
  40. package/dist/react/components/MountedTeleport/index.d.ts +0 -1
  41. package/dist/react/components/MountedTeleport/index.js +0 -1
  42. package/dist/react/components/PageLayout/PageLayout.d.ts +0 -20
  43. package/dist/react/components/PageLayout/PageLayout.js +0 -30
  44. package/dist/react/components/PageLayout/index.d.ts +0 -1
  45. package/dist/react/components/PageLayout/index.js +0 -1
  46. package/dist/react/components/ReadMore/ReadMore.d.ts +0 -12
  47. package/dist/react/components/ReadMore/ReadMore.js +0 -33
  48. package/dist/react/components/ReadMore/index.d.ts +0 -1
  49. package/dist/react/components/ReadMore/index.js +0 -1
  50. package/dist/react/components/StickyBottom/StickyBottom.d.ts +0 -9
  51. package/dist/react/components/StickyBottom/StickyBottom.js +0 -57
  52. package/dist/react/components/StickyBottom/index.d.ts +0 -1
  53. package/dist/react/components/StickyBottom/index.js +0 -1
  54. package/dist/react/components/StickyTop/StickyTop.d.ts +0 -9
  55. package/dist/react/components/StickyTop/StickyTop.js +0 -56
  56. package/dist/react/components/StickyTop/index.d.ts +0 -1
  57. package/dist/react/components/StickyTop/index.js +0 -1
  58. package/dist/react/components/index.d.ts +0 -8
  59. package/dist/react/components/index.js +0 -8
  60. package/dist/react/hooks/access.d.ts +0 -25
  61. package/dist/react/hooks/access.js +0 -41
  62. package/dist/react/hooks/core-bridge.d.ts +0 -13
  63. package/dist/react/hooks/core-bridge.js +0 -19
  64. package/dist/react/hooks/responsive.d.ts +0 -15
  65. package/dist/react/hooks/responsive.js +0 -42
  66. package/dist/react/hooks/user-preference.d.ts +0 -4
  67. package/dist/react/hooks/user-preference.js +0 -17
  68. package/dist/utils/constants.d.ts +0 -2
  69. package/dist/utils/constants.js +0 -3
  70. package/dist/utils/functions.d.ts +0 -33
  71. package/dist/utils/functions.js +0 -53
  72. package/dist/vite/index.d.ts +0 -2
  73. package/dist/vite/react.d.ts +0 -45
  74. package/dist/vite/vue.d.ts +0 -40
  75. package/dist/vue/composables/access.d.ts +0 -25
  76. package/dist/vue/composables/access.js +0 -58
  77. package/dist/vue/composables/core-bridge.d.ts +0 -12
  78. package/dist/vue/composables/core-bridge.js +0 -15
  79. package/dist/vue/composables/responsive.d.ts +0 -15
  80. package/dist/vue/composables/responsive.js +0 -35
  81. package/dist/vue/composables/user-preference.d.ts +0 -12
  82. package/dist/vue/composables/user-preference.js +0 -14
@@ -1,151 +1,135 @@
1
- import { DASHBOARD_MODULE_NAME, sanitizeId, SETTINGS_MODULE_NAME, } from '@creopse/utils/helpers';
2
- import federation from '@originjs/vite-plugin-federation';
3
- import basicSsl from '@vitejs/plugin-basic-ssl';
4
- import react from '@vitejs/plugin-react';
5
- import { parse, stringify } from 'comment-json';
6
- import fs from 'fs';
7
- import path from 'path';
8
- import copy from 'rollup-plugin-copy';
9
- import UnoCSS from 'unocss/vite';
10
- import AutoImportPlugin from 'vite-plugin-auto-import-lite';
11
- import i18nextLoader from 'vite-plugin-i18next-loader';
12
- import json5Plugin from 'vite-plugin-json5';
13
- import topLevelAwait from 'vite-plugin-top-level-await';
14
- // ——— Plugin ——————————————————————————————————————————————————————————————————
15
- export function CreopseReactPlugin(options = {}) {
16
- const { manifestPath = './manifest.jsonc', srcDir = './src', outDir = 'frontend', i18nLocalesPath, hooksDirs = ['src/hooks'], shared = [], unocss = false, eslintAutoImport = false, } = options;
17
- let root;
18
- let manifest;
19
- let pluginId;
20
- let pluginEntry;
21
- let exposes;
22
- let previewPort;
23
- let serverPort;
24
- let sslEnabled;
25
- function loadManifest() {
26
- const fullPath = path.resolve(root, manifestPath);
27
- const raw = fs.readFileSync(fullPath, 'utf-8');
28
- manifest = parse(raw || '{}');
29
- exposes = {};
30
- if (manifest.pages && Array.isArray(manifest.pages)) {
31
- for (const page of manifest.pages) {
32
- exposes[`./${page.name}`] = page.module;
1
+ import { D as y, S as b, s as D } from "../index-BWhWXGj9.js";
2
+ import L from "@originjs/vite-plugin-federation";
3
+ import C from "@vitejs/plugin-basic-ssl";
4
+ import x from "@vitejs/plugin-react";
5
+ import { stringify as M, parse as O } from "comment-json";
6
+ import j from "fs";
7
+ import s from "path";
8
+ import k from "rollup-plugin-copy";
9
+ import N from "unocss/vite";
10
+ import B from "vite-plugin-auto-import-lite";
11
+ import $ from "vite-plugin-i18next-loader";
12
+ import z from "vite-plugin-json5";
13
+ import R from "vite-plugin-top-level-await";
14
+ function Z(A = {}) {
15
+ const {
16
+ manifestPath: p = "./manifest.jsonc",
17
+ srcDir: c = "./src",
18
+ outDir: d = "frontend",
19
+ i18nLocalesPath: f,
20
+ hooksDirs: _ = ["src/hooks"],
21
+ shared: E = [],
22
+ unocss: S = !1,
23
+ eslintAutoImport: w = !1
24
+ } = A;
25
+ let r, e, u, g, t, v, P, h;
26
+ function I() {
27
+ const l = s.resolve(r, p), m = j.readFileSync(l, "utf-8");
28
+ if (e = O(m || "{}"), t = {}, e.pages && Array.isArray(e.pages))
29
+ for (const a of e.pages)
30
+ t[`./${a.name}`] = a.module;
31
+ const n = e.dashboard;
32
+ n?.module && (t[`./${y}`] = n.module);
33
+ const i = e.settings;
34
+ i?.module && (t[`./${b}`] = i.module);
35
+ const o = e.development;
36
+ u = D(String(e.id)) || "creopse-plugin", g = e.entry || "remoteEntry.js", v = o?.previewPort || 2160, P = o?.serverPort || 2161, h = o?.ssl || !1;
37
+ }
38
+ return {
39
+ name: "creopse-react-plugin",
40
+ config(l) {
41
+ r = l.root || process.cwd(), I();
42
+ const m = process.env.APP_IS_PREVIEW === "true", n = f ? s.resolve(r, f) : s.resolve(r, c, "i18n/locales"), i = ["react", "react-dom", "zustand", ...E];
43
+ return {
44
+ envPrefix: "APP_",
45
+ plugins: [
46
+ x(),
47
+ L({
48
+ name: u,
49
+ filename: g,
50
+ exposes: t,
51
+ shared: i
52
+ }),
53
+ R({
54
+ promiseExportName: "__tla",
55
+ promiseImportName: (o) => `__tla_${o}`
56
+ }),
57
+ z(),
58
+ $({
59
+ paths: [n],
60
+ include: ["**/*.json"]
61
+ }),
62
+ B({
63
+ dirs: _,
64
+ imports: ["react"],
65
+ vueTemplate: !1,
66
+ ...w ? {
67
+ eslintrc: {
68
+ enabled: !0,
69
+ filepath: "./.eslintrc-auto-import.json",
70
+ globalsPropValue: !0
71
+ }
72
+ } : {}
73
+ }),
74
+ ...S ? [N()] : [],
75
+ ...h ? [C()] : []
76
+ ],
77
+ resolve: {
78
+ alias: [
79
+ {
80
+ find: "@",
81
+ replacement: s.resolve(r, c)
33
82
  }
34
- }
35
- const dashboard = manifest.dashboard;
36
- if (dashboard?.module) {
37
- exposes[`./${DASHBOARD_MODULE_NAME}`] = dashboard.module;
38
- }
39
- const settings = manifest.settings;
40
- if (settings?.module) {
41
- exposes[`./${SETTINGS_MODULE_NAME}`] = settings.module;
42
- }
43
- const dev = manifest.development;
44
- pluginId = sanitizeId(String(manifest.id)) || 'creopse-plugin';
45
- pluginEntry = (manifest.entry || 'remoteEntry.js');
46
- previewPort = (dev?.previewPort || 2160);
47
- serverPort = (dev?.serverPort || 2161);
48
- sslEnabled = (dev?.ssl || false);
49
- }
50
- return {
51
- name: 'creopse-react-plugin',
52
- config(config) {
53
- root = config.root || process.cwd();
54
- loadManifest();
55
- const isPreview = process.env.APP_IS_PREVIEW === 'true';
56
- const localesPath = i18nLocalesPath
57
- ? path.resolve(root, i18nLocalesPath)
58
- : path.resolve(root, srcDir, 'i18n/locales');
59
- const sharedModules = ['react', 'react-dom', 'zustand', ...shared];
60
- return {
61
- envPrefix: 'APP_',
62
- plugins: [
63
- react(),
64
- federation({
65
- name: pluginId,
66
- filename: pluginEntry,
67
- exposes,
68
- shared: sharedModules,
69
- }),
70
- topLevelAwait({
71
- promiseExportName: '__tla',
72
- promiseImportName: (i) => `__tla_${i}`,
73
- }),
74
- json5Plugin(),
75
- i18nextLoader({
76
- paths: [localesPath],
77
- include: ['**/*.json'],
78
- }),
79
- AutoImportPlugin({
80
- dirs: hooksDirs,
81
- imports: ['react'],
82
- vueTemplate: false,
83
- ...(eslintAutoImport
84
- ? {
85
- eslintrc: {
86
- enabled: true,
87
- filepath: './.eslintrc-auto-import.json',
88
- globalsPropValue: true,
89
- },
90
- }
91
- : {}),
92
- }),
93
- ...(unocss ? [UnoCSS()] : []),
94
- ...(sslEnabled ? [basicSsl()] : []),
83
+ ],
84
+ dedupe: ["react", "react-dom", "zustand"]
85
+ },
86
+ build: {
87
+ target: "esnext",
88
+ outDir: d,
89
+ rollupOptions: {
90
+ plugins: [
91
+ k({
92
+ targets: [
93
+ {
94
+ src: s.resolve(r, p),
95
+ dest: d,
96
+ transform() {
97
+ return e?.mode && (e.mode = m ? "development" : "production"), ((a) => a.replace(/(,)\s*\n/g, `,
98
+
99
+ `))(
100
+ M(e, null, 2)
101
+ );
102
+ }
103
+ }
95
104
  ],
96
- resolve: {
97
- alias: [
98
- {
99
- find: '@',
100
- replacement: path.resolve(root, srcDir),
101
- },
102
- ],
103
- dedupe: ['react', 'react-dom', 'zustand'],
104
- },
105
- build: {
106
- target: 'esnext',
107
- outDir,
108
- rollupOptions: {
109
- plugins: [
110
- copy({
111
- targets: [
112
- {
113
- src: path.resolve(root, manifestPath),
114
- dest: outDir,
115
- transform() {
116
- if (manifest?.mode) {
117
- manifest.mode = isPreview ? 'development' : 'production';
118
- }
119
- const addBlankLineAfterCommas = (jsonc) => jsonc.replace(/(,)\s*\n/g, ',\n\n');
120
- return addBlankLineAfterCommas(stringify(manifest, null, 2));
121
- },
122
- },
123
- ],
124
- hook: 'writeBundle',
125
- verbose: false,
126
- flatten: true,
127
- }),
128
- ],
129
- },
130
- assetsInlineLimit: Infinity,
131
- cssCodeSplit: false,
132
- },
133
- preview: {
134
- port: previewPort,
135
- strictPort: true,
136
- cors: true,
137
- headers: {
138
- 'Access-Control-Allow-Origin': '*',
139
- },
140
- },
141
- server: {
142
- port: serverPort,
143
- cors: true,
144
- headers: {
145
- 'Access-Control-Allow-Origin': '*',
146
- },
147
- },
148
- };
105
+ hook: "writeBundle",
106
+ verbose: !1,
107
+ flatten: !0
108
+ })
109
+ ]
110
+ },
111
+ assetsInlineLimit: 1 / 0,
112
+ cssCodeSplit: !1
113
+ },
114
+ preview: {
115
+ port: v,
116
+ strictPort: !0,
117
+ cors: !0,
118
+ headers: {
119
+ "Access-Control-Allow-Origin": "*"
120
+ }
149
121
  },
150
- };
122
+ server: {
123
+ port: P,
124
+ cors: !0,
125
+ headers: {
126
+ "Access-Control-Allow-Origin": "*"
127
+ }
128
+ }
129
+ };
130
+ }
131
+ };
151
132
  }
133
+ export {
134
+ Z as CreopseReactPlugin
135
+ };
package/dist/vite/vue.js CHANGED
@@ -1,142 +1,127 @@
1
- import { DASHBOARD_MODULE_NAME, sanitizeId, SETTINGS_MODULE_NAME, } from '@creopse/utils/helpers';
2
- import federation from '@originjs/vite-plugin-federation';
3
- import basicSsl from '@vitejs/plugin-basic-ssl';
4
- import vue from '@vitejs/plugin-vue';
5
- import { parse, stringify } from 'comment-json';
6
- import fs from 'fs';
7
- import path from 'path';
8
- import copy from 'rollup-plugin-copy';
9
- import UnoCSS from 'unocss/vite';
10
- import AutoImportPlugin from 'vite-plugin-auto-import-lite';
11
- import i18nextLoader from 'vite-plugin-i18next-loader';
12
- import json5Plugin from 'vite-plugin-json5';
13
- import topLevelAwait from 'vite-plugin-top-level-await';
14
- // ——— Plugin ——————————————————————————————————————————————————————————————————
15
- export function CreopseVuePlugin(options = {}) {
16
- const { manifestPath = './manifest.jsonc', srcDir = './src', outDir = 'frontend', i18nLocalesPath, composablesDirs = ['src/composables'], shared = [], unocss = false, } = options;
17
- let root;
18
- let manifest;
19
- let pluginId;
20
- let pluginEntry;
21
- let exposes;
22
- let previewPort;
23
- let serverPort;
24
- let sslEnabled;
25
- function loadManifest() {
26
- const fullPath = path.resolve(root, manifestPath);
27
- const raw = fs.readFileSync(fullPath, 'utf-8');
28
- manifest = parse(raw || '{}');
29
- exposes = {};
30
- if (manifest.pages && Array.isArray(manifest.pages)) {
31
- for (const page of manifest.pages) {
32
- exposes[`./${page.name}`] = page.module;
1
+ import { D as y, S as I, s as b } from "../index-BWhWXGj9.js";
2
+ import D from "@originjs/vite-plugin-federation";
3
+ import L from "@vitejs/plugin-basic-ssl";
4
+ import C from "@vitejs/plugin-vue";
5
+ import { stringify as x, parse as M } from "comment-json";
6
+ import O from "fs";
7
+ import t from "path";
8
+ import N from "rollup-plugin-copy";
9
+ import j from "unocss/vite";
10
+ import B from "vite-plugin-auto-import-lite";
11
+ import $ from "vite-plugin-i18next-loader";
12
+ import k from "vite-plugin-json5";
13
+ import T from "vite-plugin-top-level-await";
14
+ function Y(h = {}) {
15
+ const {
16
+ manifestPath: p = "./manifest.jsonc",
17
+ srcDir: c = "./src",
18
+ outDir: u = "frontend",
19
+ i18nLocalesPath: d,
20
+ composablesDirs: _ = ["src/composables"],
21
+ shared: E = [],
22
+ unocss: S = !1
23
+ } = h;
24
+ let r, e, f, v, s, g, P, A;
25
+ function w() {
26
+ const a = t.resolve(r, p), m = O.readFileSync(a, "utf-8");
27
+ if (e = M(m || "{}"), s = {}, e.pages && Array.isArray(e.pages))
28
+ for (const l of e.pages)
29
+ s[`./${l.name}`] = l.module;
30
+ const n = e.dashboard;
31
+ n?.module && (s[`./${y}`] = n.module);
32
+ const i = e.settings;
33
+ i?.module && (s[`./${I}`] = i.module);
34
+ const o = e.development;
35
+ f = b(String(e.id)) || "creopse-plugin", v = e.entry || "remoteEntry.js", g = o?.previewPort || 2160, P = o?.serverPort || 2161, A = o?.ssl || !1;
36
+ }
37
+ return {
38
+ name: "creopse-vue-plugin",
39
+ config(a) {
40
+ r = a.root || process.cwd(), w();
41
+ const m = process.env.APP_IS_PREVIEW === "true", n = d ? t.resolve(r, d) : t.resolve(r, c, "i18n/locales"), i = ["vue", "pinia", ...E];
42
+ return {
43
+ envPrefix: "APP_",
44
+ plugins: [
45
+ C(),
46
+ D({
47
+ name: f,
48
+ filename: v,
49
+ exposes: s,
50
+ shared: i
51
+ }),
52
+ T({
53
+ promiseExportName: "__tla",
54
+ promiseImportName: (o) => `__tla_${o}`
55
+ }),
56
+ k(),
57
+ $({
58
+ paths: [n],
59
+ include: ["**/*.json"]
60
+ }),
61
+ B({
62
+ dirs: _,
63
+ imports: ["vue", "pinia"],
64
+ vueTemplate: !0
65
+ }),
66
+ ...S ? [j()] : [],
67
+ ...A ? [L()] : []
68
+ ],
69
+ resolve: {
70
+ alias: [
71
+ {
72
+ find: "@",
73
+ replacement: t.resolve(r, c)
33
74
  }
34
- }
35
- const dashboard = manifest.dashboard;
36
- if (dashboard?.module) {
37
- exposes[`./${DASHBOARD_MODULE_NAME}`] = dashboard.module;
38
- }
39
- const settings = manifest.settings;
40
- if (settings?.module) {
41
- exposes[`./${SETTINGS_MODULE_NAME}`] = settings.module;
42
- }
43
- const dev = manifest.development;
44
- pluginId = sanitizeId(String(manifest.id)) || 'creopse-plugin';
45
- pluginEntry = (manifest.entry || 'remoteEntry.js');
46
- previewPort = (dev?.previewPort || 2160);
47
- serverPort = (dev?.serverPort || 2161);
48
- sslEnabled = (dev?.ssl || false);
49
- }
50
- return {
51
- name: 'creopse-vue-plugin',
52
- config(config) {
53
- root = config.root || process.cwd();
54
- loadManifest();
55
- const isPreview = process.env.APP_IS_PREVIEW === 'true';
56
- const localesPath = i18nLocalesPath
57
- ? path.resolve(root, i18nLocalesPath)
58
- : path.resolve(root, srcDir, 'i18n/locales');
59
- const sharedModules = ['vue', 'pinia', ...shared];
60
- return {
61
- envPrefix: 'APP_',
62
- plugins: [
63
- vue(),
64
- federation({
65
- name: pluginId,
66
- filename: pluginEntry,
67
- exposes,
68
- shared: sharedModules,
69
- }),
70
- topLevelAwait({
71
- promiseExportName: '__tla',
72
- promiseImportName: (i) => `__tla_${i}`,
73
- }),
74
- json5Plugin(),
75
- i18nextLoader({
76
- paths: [localesPath],
77
- include: ['**/*.json'],
78
- }),
79
- AutoImportPlugin({
80
- dirs: composablesDirs,
81
- imports: ['vue', 'pinia'],
82
- vueTemplate: true,
83
- }),
84
- ...(unocss ? [UnoCSS()] : []),
85
- ...(sslEnabled ? [basicSsl()] : []),
75
+ ],
76
+ dedupe: ["vue"]
77
+ },
78
+ build: {
79
+ target: "esnext",
80
+ outDir: u,
81
+ rollupOptions: {
82
+ plugins: [
83
+ N({
84
+ targets: [
85
+ {
86
+ src: t.resolve(r, p),
87
+ dest: u,
88
+ transform() {
89
+ return e?.mode && (e.mode = m ? "development" : "production"), ((l) => l.replace(/(,)\s*\n/g, `,
90
+
91
+ `))(
92
+ x(e, null, 2)
93
+ );
94
+ }
95
+ }
86
96
  ],
87
- resolve: {
88
- alias: [
89
- {
90
- find: '@',
91
- replacement: path.resolve(root, srcDir),
92
- },
93
- ],
94
- dedupe: ['vue'],
95
- },
96
- build: {
97
- target: 'esnext',
98
- outDir,
99
- rollupOptions: {
100
- plugins: [
101
- copy({
102
- targets: [
103
- {
104
- src: path.resolve(root, manifestPath),
105
- dest: outDir,
106
- transform() {
107
- if (manifest?.mode) {
108
- manifest.mode = isPreview ? 'development' : 'production';
109
- }
110
- const addBlankLineAfterCommas = (jsonc) => jsonc.replace(/(,)\s*\n/g, ',\n\n');
111
- return addBlankLineAfterCommas(stringify(manifest, null, 2));
112
- },
113
- },
114
- ],
115
- hook: 'writeBundle',
116
- verbose: false,
117
- flatten: true,
118
- }),
119
- ],
120
- },
121
- assetsInlineLimit: Infinity,
122
- cssCodeSplit: false,
123
- },
124
- preview: {
125
- port: previewPort,
126
- strictPort: true,
127
- cors: true,
128
- headers: {
129
- 'Access-Control-Allow-Origin': '*',
130
- },
131
- },
132
- server: {
133
- port: serverPort,
134
- cors: true,
135
- headers: {
136
- 'Access-Control-Allow-Origin': '*',
137
- },
138
- },
139
- };
97
+ hook: "writeBundle",
98
+ verbose: !1,
99
+ flatten: !0
100
+ })
101
+ ]
102
+ },
103
+ assetsInlineLimit: 1 / 0,
104
+ cssCodeSplit: !1
105
+ },
106
+ preview: {
107
+ port: g,
108
+ strictPort: !0,
109
+ cors: !0,
110
+ headers: {
111
+ "Access-Control-Allow-Origin": "*"
112
+ }
140
113
  },
141
- };
114
+ server: {
115
+ port: P,
116
+ cors: !0,
117
+ headers: {
118
+ "Access-Control-Allow-Origin": "*"
119
+ }
120
+ }
121
+ };
122
+ }
123
+ };
142
124
  }
125
+ export {
126
+ Y as CreopseVuePlugin
127
+ };
@@ -0,0 +1,15 @@
1
+ import "vue";
2
+ import "@iconify/vue";
3
+ import "naive-ui";
4
+ import { useResponsive as i } from "./bridge2.js";
5
+ import "./bridge3.js";
6
+ import { useCoreBridge as u } from "./bridge4.js";
7
+ import "./bridge5.js";
8
+ import { useAccess as c } from "./bridge6.js";
9
+ import { useUserPreference as d } from "./bridge7.js";
10
+ export {
11
+ c as useAccess,
12
+ u as useCoreBridge,
13
+ i as useResponsive,
14
+ d as useUserPreference
15
+ };
@@ -0,0 +1,27 @@
1
+ import { useMediaQuery as i } from "@vueuse/core";
2
+ import { computed as o } from "vue";
3
+ const f = () => {
4
+ const s = i("(min-width: 1536px)"), e = i(
5
+ "(min-width: 1280px) and (max-width: 1535px)"
6
+ ), m = i(
7
+ "(min-width: 1024px) and (max-width: 1279px)"
8
+ ), c = i("(min-width: 768px) and (max-width: 1023px)"), d = i("(max-width: 767px)"), p = i("(min-width: 640px)"), t = i("(min-width: 768px)"), n = i("(min-width: 1024px)"), r = i("(min-width: 1280px)"), x = i("(min-width: 1536px)"), a = o(() => !t.value), h = o(() => t.value && !n.value), w = o(() => n.value);
9
+ return {
10
+ is2XlScreen: s,
11
+ isXlScreen: e,
12
+ isLgScreen: m,
13
+ isMdScreen: c,
14
+ isSmScreen: d,
15
+ fromSm: p,
16
+ fromMd: t,
17
+ fromLg: n,
18
+ fromXl: r,
19
+ from2Xl: x,
20
+ isMobile: a,
21
+ isTablet: h,
22
+ isDesktop: w
23
+ };
24
+ };
25
+ export {
26
+ f as useResponsive
27
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,18 @@
1
+ const t = () => {
2
+ const { sharedData: e, api: o, i18n: a, router: s, helpers: n, stores: r } = window.__creopse__;
3
+ return {
4
+ locale: e?.locale,
5
+ env: e?.env,
6
+ appConfig: e?.appConfig,
7
+ api: o,
8
+ i18n: a,
9
+ router: s,
10
+ helpers: n,
11
+ auth: r.auth,
12
+ server: r.server,
13
+ ui: r.ui
14
+ };
15
+ };
16
+ export {
17
+ t as useCoreBridge
18
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,41 @@
1
+ import { AccessGuard as a, UserRole as i, Permission as d } from "@creopse/utils/enums";
2
+ import { useI18n as g } from "vue-i18n";
3
+ const I = () => {
4
+ const { t: u } = g(), c = (e, s) => (e?.findIndex(
5
+ (n) => n.name === s
6
+ ) ?? -1) > -1, t = (e, s) => (e?.findIndex((n) => n.name === s) ?? -1) > -1, l = (e) => t(e, i.SUPER_ADMIN), o = (e) => Object.values(d).includes(e), r = [
7
+ {
8
+ label: "API",
9
+ value: a.API,
10
+ tagType: "warning"
11
+ },
12
+ {
13
+ label: "Web",
14
+ value: a.WEB,
15
+ tagType: "info"
16
+ },
17
+ {
18
+ label: "Admin",
19
+ value: a.ADMIN,
20
+ tagType: "success"
21
+ },
22
+ {
23
+ label: "Mobile",
24
+ value: a.MOBILE,
25
+ tagType: "error"
26
+ }
27
+ ];
28
+ return {
29
+ accessGuards: r,
30
+ getAccessGuardLabel: (e) => r.find((s) => s.value === e)?.label,
31
+ getAccessGuardTagType: (e) => r.find((s) => s.value === e)?.tagType || "default",
32
+ getRoleName: (e, s) => e?.find((n) => n.id === s)?.name || u("undefined"),
33
+ isPermissionNative: o,
34
+ userIsSuperAdmin: l,
35
+ userCan: c,
36
+ userIs: t
37
+ };
38
+ };
39
+ export {
40
+ I as useAccess
41
+ };