@opentiny/tiny-engine-canvas 2.0.0-alpha.1 → 2.0.0-alpha.3

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/dist/utils.js ADDED
@@ -0,0 +1,56 @@
1
+ const l = (e, s) => {
2
+ const n = e.__vccOpts || e;
3
+ for (const [o, t] of s)
4
+ n[o] = t;
5
+ return n;
6
+ }, p = "data-uid", m = "data-tag", y = "loop-id", u = (e, s = document) => new Promise((n, o) => {
7
+ const t = s.createElement("script");
8
+ t.setAttribute("type", "text/javascript"), t.setAttribute("src", e), t.async = !1, t.onload = n, t.onerror = o, s.querySelector("head").appendChild(t);
9
+ }), i = (e, s = document) => new Promise((n, o) => {
10
+ const t = s.createElement("link");
11
+ t.setAttribute("href", e), t.setAttribute("rel", "stylesheet"), t.onload = n, t.onerror = o, s.querySelector("head").appendChild(t);
12
+ }), c = (e) => {
13
+ if (typeof e == "object") {
14
+ if (!e)
15
+ return e;
16
+ if (Array.isArray(e))
17
+ return e.map(c);
18
+ const s = {};
19
+ Object.keys(e).forEach((t) => {
20
+ s[t] = c(e[t]);
21
+ });
22
+ const { componentName: n, id: o } = s;
23
+ return n && o && delete s.id, s;
24
+ }
25
+ return e;
26
+ }, d = async ({ package: e, script: s, components: n }) => {
27
+ if (!s) return;
28
+ const o = s.startsWith(".") ? new URL(s, location.href).href : s;
29
+ if (!window.TinyComponentLibs[e]) {
30
+ const t = await import(
31
+ /* @vite-ignore */
32
+ o
33
+ );
34
+ window.TinyComponentLibs[e] = t;
35
+ }
36
+ Object.entries(n).forEach(([t, a]) => {
37
+ const r = window.TinyComponentLibs[e];
38
+ window.TinyLowcodeComponent[t] || (window.TinyLowcodeComponent[t] = r[a]);
39
+ });
40
+ }, f = ({ detail: e }) => {
41
+ const { scripts: s = [], styles: n = [] } = e || {}, { styles: o } = window.thirdPartyDeps, t = [...n].filter((r) => !o.has(r));
42
+ t.forEach((r) => o.add(r));
43
+ const a = [...t].map((r) => i(r)).concat(s.map(d));
44
+ Promise.allSettled(a);
45
+ };
46
+ export {
47
+ p as N,
48
+ l as _,
49
+ y as a,
50
+ i as b,
51
+ c,
52
+ u as d,
53
+ m as e,
54
+ d as f,
55
+ f as u
56
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-canvas",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,6 +14,14 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./render": {
22
+ "import": "./dist/render.js"
23
+ }
24
+ },
17
25
  "repository": {
18
26
  "type": "git",
19
27
  "url": "https://github.com/opentiny/tiny-engine",
@@ -25,25 +33,26 @@
25
33
  "author": "OpenTiny Team",
26
34
  "license": "MIT",
27
35
  "homepage": "https://opentiny.design/tiny-engine",
36
+ "type": "module",
28
37
  "dependencies": {
29
38
  "@babel/core": "7.18.13",
30
- "@opentiny/tiny-engine-builtin-component": "2.0.0-alpha.1",
31
- "@opentiny/tiny-engine-common": "2.0.0-alpha.1",
32
- "@opentiny/tiny-engine-http": "2.0.0-alpha.1",
33
- "@opentiny/tiny-engine-i18n-host": "2.0.0-alpha.1",
34
- "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.1",
35
- "@opentiny/tiny-engine-utils": "2.0.0-alpha.1",
36
- "@opentiny/tiny-engine-webcomponent-core": "2.0.0-alpha.1",
39
+ "@opentiny/tiny-engine-builtin-component": "2.0.0-alpha.3",
40
+ "@opentiny/tiny-engine-common": "2.0.0-alpha.3",
41
+ "@opentiny/tiny-engine-http": "2.0.0-alpha.3",
42
+ "@opentiny/tiny-engine-i18n-host": "2.0.0-alpha.3",
43
+ "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3",
44
+ "@opentiny/tiny-engine-utils": "2.0.0-alpha.3",
45
+ "@opentiny/tiny-engine-webcomponent-core": "2.0.0-alpha.3",
37
46
  "@vue/babel-plugin-jsx": "1.1.1",
38
47
  "@vue/shared": "^3.3.4",
39
48
  "@vueuse/core": "^9.6.0"
40
49
  },
41
50
  "devDependencies": {
42
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.1",
43
- "@vitejs/plugin-vue": "^4.2.3",
44
- "@vitejs/plugin-vue-jsx": "^3.1.0",
45
- "rollup-plugin-terser": "^7.0.2",
46
- "vite": "^4.3.7"
51
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
52
+ "@vitejs/plugin-vue": "^5.1.2",
53
+ "@vitejs/plugin-vue-jsx": "^4.0.1",
54
+ "rollup-plugin-polyfill-node": "^0.13.0",
55
+ "vite": "^5.4.2"
47
56
  },
48
57
  "peerDependencies": {
49
58
  "@opentiny/vue": "^3.14.0",
@@ -52,5 +61,5 @@
52
61
  "vue": "^3.4.15",
53
62
  "vue-i18n": "^9.9.0"
54
63
  },
55
- "gitHead": "f15ccc5dde391288bf4297e3ffc35aab52651f3d"
64
+ "gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
56
65
  }