@gsc-basic/components 1.0.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 (231) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/es/index.js +35 -0
  3. package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1371 -0
  4. package/dist/es/node_modules/@codemirror/commands/dist/index.js +838 -0
  5. package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +38 -0
  6. package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +300 -0
  7. package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +48 -0
  8. package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +399 -0
  9. package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +497 -0
  10. package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +216 -0
  11. package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +51 -0
  12. package/dist/es/node_modules/@codemirror/language/dist/index.js +1299 -0
  13. package/dist/es/node_modules/@codemirror/lint/dist/index.js +649 -0
  14. package/dist/es/node_modules/@codemirror/search/dist/index.js +872 -0
  15. package/dist/es/node_modules/@codemirror/state/dist/index.js +2639 -0
  16. package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +132 -0
  17. package/dist/es/node_modules/@codemirror/view/dist/index.js +7280 -0
  18. package/dist/es/node_modules/@lezer/common/dist/index.js +1430 -0
  19. package/dist/es/node_modules/@lezer/highlight/dist/index.js +637 -0
  20. package/dist/es/node_modules/@lezer/java/dist/index.js +62 -0
  21. package/dist/es/node_modules/@lezer/javascript/dist/index.js +161 -0
  22. package/dist/es/node_modules/@lezer/json/dist/index.js +34 -0
  23. package/dist/es/node_modules/@lezer/lr/dist/index.js +1307 -0
  24. package/dist/es/node_modules/@lezer/python/dist/index.js +221 -0
  25. package/dist/es/node_modules/@lezer/xml/dist/index.js +100 -0
  26. package/dist/es/node_modules/@lezer/yaml/dist/index.js +274 -0
  27. package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +69 -0
  28. package/dist/es/node_modules/@vueuse/core/dist/index.js +125 -0
  29. package/dist/es/node_modules/@vueuse/shared/dist/index.js +55 -0
  30. package/dist/es/node_modules/codemirror/dist/index.js +40 -0
  31. package/dist/es/node_modules/crelt/index.js +27 -0
  32. package/dist/es/node_modules/lodash-es/_Hash.js +20 -0
  33. package/dist/es/node_modules/lodash-es/_ListCache.js +20 -0
  34. package/dist/es/node_modules/lodash-es/_Map.js +6 -0
  35. package/dist/es/node_modules/lodash-es/_MapCache.js +20 -0
  36. package/dist/es/node_modules/lodash-es/_Symbol.js +5 -0
  37. package/dist/es/node_modules/lodash-es/_arrayMap.js +8 -0
  38. package/dist/es/node_modules/lodash-es/_assocIndexOf.js +10 -0
  39. package/dist/es/node_modules/lodash-es/_baseGet.js +11 -0
  40. package/dist/es/node_modules/lodash-es/_baseGetTag.js +10 -0
  41. package/dist/es/node_modules/lodash-es/_baseIsNative.js +16 -0
  42. package/dist/es/node_modules/lodash-es/_baseToString.js +18 -0
  43. package/dist/es/node_modules/lodash-es/_castPath.js +10 -0
  44. package/dist/es/node_modules/lodash-es/_coreJsData.js +5 -0
  45. package/dist/es/node_modules/lodash-es/_freeGlobal.js +4 -0
  46. package/dist/es/node_modules/lodash-es/_getMapData.js +8 -0
  47. package/dist/es/node_modules/lodash-es/_getNative.js +9 -0
  48. package/dist/es/node_modules/lodash-es/_getRawTag.js +15 -0
  49. package/dist/es/node_modules/lodash-es/_getValue.js +6 -0
  50. package/dist/es/node_modules/lodash-es/_hashClear.js +7 -0
  51. package/dist/es/node_modules/lodash-es/_hashDelete.js +7 -0
  52. package/dist/es/node_modules/lodash-es/_hashGet.js +13 -0
  53. package/dist/es/node_modules/lodash-es/_hashHas.js +9 -0
  54. package/dist/es/node_modules/lodash-es/_hashSet.js +9 -0
  55. package/dist/es/node_modules/lodash-es/_isKey.js +12 -0
  56. package/dist/es/node_modules/lodash-es/_isKeyable.js +7 -0
  57. package/dist/es/node_modules/lodash-es/_isMasked.js +11 -0
  58. package/dist/es/node_modules/lodash-es/_listCacheClear.js +6 -0
  59. package/dist/es/node_modules/lodash-es/_listCacheDelete.js +12 -0
  60. package/dist/es/node_modules/lodash-es/_listCacheGet.js +8 -0
  61. package/dist/es/node_modules/lodash-es/_listCacheHas.js +7 -0
  62. package/dist/es/node_modules/lodash-es/_listCacheSet.js +8 -0
  63. package/dist/es/node_modules/lodash-es/_mapCacheClear.js +13 -0
  64. package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  65. package/dist/es/node_modules/lodash-es/_mapCacheGet.js +7 -0
  66. package/dist/es/node_modules/lodash-es/_mapCacheHas.js +7 -0
  67. package/dist/es/node_modules/lodash-es/_mapCacheSet.js +8 -0
  68. package/dist/es/node_modules/lodash-es/_memoizeCapped.js +11 -0
  69. package/dist/es/node_modules/lodash-es/_nativeCreate.js +5 -0
  70. package/dist/es/node_modules/lodash-es/_objectToString.js +7 -0
  71. package/dist/es/node_modules/lodash-es/_root.js +5 -0
  72. package/dist/es/node_modules/lodash-es/_stringToPath.js +10 -0
  73. package/dist/es/node_modules/lodash-es/_toKey.js +10 -0
  74. package/dist/es/node_modules/lodash-es/_toSource.js +17 -0
  75. package/dist/es/node_modules/lodash-es/eq.js +6 -0
  76. package/dist/es/node_modules/lodash-es/get.js +8 -0
  77. package/dist/es/node_modules/lodash-es/isArray.js +4 -0
  78. package/dist/es/node_modules/lodash-es/isFunction.js +12 -0
  79. package/dist/es/node_modules/lodash-es/isNil.js +6 -0
  80. package/dist/es/node_modules/lodash-es/isObject.js +7 -0
  81. package/dist/es/node_modules/lodash-es/isObjectLike.js +6 -0
  82. package/dist/es/node_modules/lodash-es/isString.js +10 -0
  83. package/dist/es/node_modules/lodash-es/isSymbol.js +9 -0
  84. package/dist/es/node_modules/lodash-es/memoize.js +18 -0
  85. package/dist/es/node_modules/lodash-es/toString.js +7 -0
  86. package/dist/es/node_modules/style-mod/src/style-mod.js +109 -0
  87. package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +132 -0
  88. package/dist/es/node_modules/w3c-keyname/index.js +93 -0
  89. package/dist/es/src/CodeEditor/index.js +6 -0
  90. package/dist/es/src/CodeEditor/src/index.css +1 -0
  91. package/dist/es/src/CodeEditor/src/index.vue.js +128 -0
  92. package/dist/es/src/CodeEditor/src/index2.css +1 -0
  93. package/dist/es/src/ConfigProvider/index.js +7 -0
  94. package/dist/es/src/ConfigProvider/src/configProvider.js +14 -0
  95. package/dist/es/src/ConfigProvider/src/configProviderProps.js +22 -0
  96. package/dist/es/src/ConfigProvider/src/constants.js +9 -0
  97. package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +45 -0
  98. package/dist/es/src/ScaleScreen/index.js +6 -0
  99. package/dist/es/src/ScaleScreen/src/index.css +1 -0
  100. package/dist/es/src/ScaleScreen/src/index.vue.js +115 -0
  101. package/dist/es/src/ScaleScreen/src/index2.css +1 -0
  102. package/dist/es/src/VideoBackground/index.js +6 -0
  103. package/dist/es/src/VideoBackground/src/helper.js +29 -0
  104. package/dist/es/src/VideoBackground/src/index.css +1 -0
  105. package/dist/es/src/VideoBackground/src/index.vue.js +108 -0
  106. package/dist/es/src/VideoBackground/src/index2.css +1 -0
  107. package/dist/es/src/VideoBackground/src/index3.css +1 -0
  108. package/dist/es/src/VideoBackground/src/videoBackground.js +31 -0
  109. package/dist/es/src/hooks/useLocale.js +24 -0
  110. package/dist/es/src/hooks/useNamespace.js +8 -0
  111. package/dist/es/src/index.js +28 -0
  112. package/dist/es/src/locale/lang/en-US.js +32 -0
  113. package/dist/es/src/locale/lang/ja-JP.js +32 -0
  114. package/dist/es/src/locale/lang/zh-CN.js +32 -0
  115. package/dist/es/src/styles/tokens.css +1 -0
  116. package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
  117. package/dist/lib/index.js +1 -0
  118. package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +1 -0
  119. package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -0
  120. package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +1 -0
  121. package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +13 -0
  122. package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +1 -0
  123. package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +3 -0
  124. package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +2 -0
  125. package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +1 -0
  126. package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +1 -0
  127. package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -0
  128. package/dist/lib/node_modules/@codemirror/lint/dist/index.js +1 -0
  129. package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -0
  130. package/dist/lib/node_modules/@codemirror/state/dist/index.js +5 -0
  131. package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -0
  132. package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -0
  133. package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -0
  134. package/dist/lib/node_modules/@lezer/highlight/dist/index.js +1 -0
  135. package/dist/lib/node_modules/@lezer/java/dist/index.js +1 -0
  136. package/dist/lib/node_modules/@lezer/javascript/dist/index.js +1 -0
  137. package/dist/lib/node_modules/@lezer/json/dist/index.js +1 -0
  138. package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -0
  139. package/dist/lib/node_modules/@lezer/python/dist/index.js +1 -0
  140. package/dist/lib/node_modules/@lezer/xml/dist/index.js +1 -0
  141. package/dist/lib/node_modules/@lezer/yaml/dist/index.js +1 -0
  142. package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +1 -0
  143. package/dist/lib/node_modules/@vueuse/core/dist/index.js +1 -0
  144. package/dist/lib/node_modules/@vueuse/shared/dist/index.js +1 -0
  145. package/dist/lib/node_modules/codemirror/dist/index.js +1 -0
  146. package/dist/lib/node_modules/crelt/index.js +1 -0
  147. package/dist/lib/node_modules/lodash-es/_Hash.js +1 -0
  148. package/dist/lib/node_modules/lodash-es/_ListCache.js +1 -0
  149. package/dist/lib/node_modules/lodash-es/_Map.js +1 -0
  150. package/dist/lib/node_modules/lodash-es/_MapCache.js +1 -0
  151. package/dist/lib/node_modules/lodash-es/_Symbol.js +1 -0
  152. package/dist/lib/node_modules/lodash-es/_arrayMap.js +1 -0
  153. package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +1 -0
  154. package/dist/lib/node_modules/lodash-es/_baseGet.js +1 -0
  155. package/dist/lib/node_modules/lodash-es/_baseGetTag.js +1 -0
  156. package/dist/lib/node_modules/lodash-es/_baseIsNative.js +1 -0
  157. package/dist/lib/node_modules/lodash-es/_baseToString.js +1 -0
  158. package/dist/lib/node_modules/lodash-es/_castPath.js +1 -0
  159. package/dist/lib/node_modules/lodash-es/_coreJsData.js +1 -0
  160. package/dist/lib/node_modules/lodash-es/_freeGlobal.js +1 -0
  161. package/dist/lib/node_modules/lodash-es/_getMapData.js +1 -0
  162. package/dist/lib/node_modules/lodash-es/_getNative.js +1 -0
  163. package/dist/lib/node_modules/lodash-es/_getRawTag.js +1 -0
  164. package/dist/lib/node_modules/lodash-es/_getValue.js +1 -0
  165. package/dist/lib/node_modules/lodash-es/_hashClear.js +1 -0
  166. package/dist/lib/node_modules/lodash-es/_hashDelete.js +1 -0
  167. package/dist/lib/node_modules/lodash-es/_hashGet.js +1 -0
  168. package/dist/lib/node_modules/lodash-es/_hashHas.js +1 -0
  169. package/dist/lib/node_modules/lodash-es/_hashSet.js +1 -0
  170. package/dist/lib/node_modules/lodash-es/_isKey.js +1 -0
  171. package/dist/lib/node_modules/lodash-es/_isKeyable.js +1 -0
  172. package/dist/lib/node_modules/lodash-es/_isMasked.js +1 -0
  173. package/dist/lib/node_modules/lodash-es/_listCacheClear.js +1 -0
  174. package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +1 -0
  175. package/dist/lib/node_modules/lodash-es/_listCacheGet.js +1 -0
  176. package/dist/lib/node_modules/lodash-es/_listCacheHas.js +1 -0
  177. package/dist/lib/node_modules/lodash-es/_listCacheSet.js +1 -0
  178. package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +1 -0
  179. package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +1 -0
  180. package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +1 -0
  181. package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +1 -0
  182. package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +1 -0
  183. package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +1 -0
  184. package/dist/lib/node_modules/lodash-es/_nativeCreate.js +1 -0
  185. package/dist/lib/node_modules/lodash-es/_objectToString.js +1 -0
  186. package/dist/lib/node_modules/lodash-es/_root.js +1 -0
  187. package/dist/lib/node_modules/lodash-es/_stringToPath.js +1 -0
  188. package/dist/lib/node_modules/lodash-es/_toKey.js +1 -0
  189. package/dist/lib/node_modules/lodash-es/_toSource.js +1 -0
  190. package/dist/lib/node_modules/lodash-es/eq.js +1 -0
  191. package/dist/lib/node_modules/lodash-es/get.js +1 -0
  192. package/dist/lib/node_modules/lodash-es/isArray.js +1 -0
  193. package/dist/lib/node_modules/lodash-es/isFunction.js +1 -0
  194. package/dist/lib/node_modules/lodash-es/isNil.js +1 -0
  195. package/dist/lib/node_modules/lodash-es/isObject.js +1 -0
  196. package/dist/lib/node_modules/lodash-es/isObjectLike.js +1 -0
  197. package/dist/lib/node_modules/lodash-es/isString.js +1 -0
  198. package/dist/lib/node_modules/lodash-es/isSymbol.js +1 -0
  199. package/dist/lib/node_modules/lodash-es/memoize.js +1 -0
  200. package/dist/lib/node_modules/lodash-es/toString.js +1 -0
  201. package/dist/lib/node_modules/style-mod/src/style-mod.js +3 -0
  202. package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +1 -0
  203. package/dist/lib/node_modules/w3c-keyname/index.js +1 -0
  204. package/dist/lib/src/CodeEditor/index.js +1 -0
  205. package/dist/lib/src/CodeEditor/src/index.css +1 -0
  206. package/dist/lib/src/CodeEditor/src/index.vue.js +1 -0
  207. package/dist/lib/src/CodeEditor/src/index2.css +1 -0
  208. package/dist/lib/src/ConfigProvider/index.js +1 -0
  209. package/dist/lib/src/ConfigProvider/src/configProvider.js +1 -0
  210. package/dist/lib/src/ConfigProvider/src/configProviderProps.js +1 -0
  211. package/dist/lib/src/ConfigProvider/src/constants.js +1 -0
  212. package/dist/lib/src/ConfigProvider/src/useGlobalConfig.js +1 -0
  213. package/dist/lib/src/ScaleScreen/index.js +1 -0
  214. package/dist/lib/src/ScaleScreen/src/index.css +1 -0
  215. package/dist/lib/src/ScaleScreen/src/index.vue.js +1 -0
  216. package/dist/lib/src/ScaleScreen/src/index2.css +1 -0
  217. package/dist/lib/src/VideoBackground/index.js +1 -0
  218. package/dist/lib/src/VideoBackground/src/helper.js +1 -0
  219. package/dist/lib/src/VideoBackground/src/index.css +1 -0
  220. package/dist/lib/src/VideoBackground/src/index.vue.js +1 -0
  221. package/dist/lib/src/VideoBackground/src/index2.css +1 -0
  222. package/dist/lib/src/VideoBackground/src/index3.css +1 -0
  223. package/dist/lib/src/VideoBackground/src/videoBackground.js +1 -0
  224. package/dist/lib/src/hooks/useLocale.js +1 -0
  225. package/dist/lib/src/hooks/useNamespace.js +1 -0
  226. package/dist/lib/src/index.js +1 -0
  227. package/dist/lib/src/locale/lang/en-US.js +1 -0
  228. package/dist/lib/src/locale/lang/ja-JP.js +1 -0
  229. package/dist/lib/src/locale/lang/zh-CN.js +1 -0
  230. package/dist/lib/src/styles/tokens.css +1 -0
  231. package/package.json +71 -0
@@ -0,0 +1,132 @@
1
+ import { defineComponent as T, shallowRef as y, inject as B, computed as z, toRaw as E, onMounted as P, watch as d, onBeforeUnmount as V, h as W } from "vue";
2
+ import { basicSetup as R } from "../../codemirror/dist/index.js";
3
+ import { EditorState as g, Compartment as A, StateEffect as I } from "../../@codemirror/state/dist/index.js";
4
+ import { EditorView as h, keymap as M, placeholder as k } from "../../@codemirror/view/dist/index.js";
5
+ import { indentWithTab as L } from "../../@codemirror/commands/dist/index.js";
6
+ import { indentUnit as N } from "../../@codemirror/language/dist/index.js";
7
+ var G = Object.freeze({ autofocus: !1, disabled: !1, indentWithTab: !0, tabSize: 2, placeholder: "", autoDestroy: !0, extensions: [R] }), _ = /* @__PURE__ */ Symbol("vue-codemirror-global-config"), u, $ = function(t) {
8
+ var r = t.onUpdate, c = t.onChange, m = t.onFocus, f = t.onBlur, s = (function(n, l) {
9
+ var o = {};
10
+ for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && l.indexOf(e) < 0 && (o[e] = n[e]);
11
+ if (n != null && typeof Object.getOwnPropertySymbols == "function") {
12
+ var i = 0;
13
+ for (e = Object.getOwnPropertySymbols(n); i < e.length; i++) l.indexOf(e[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, e[i]) && (o[e[i]] = n[e[i]]);
14
+ }
15
+ return o;
16
+ })(t, ["onUpdate", "onChange", "onFocus", "onBlur"]);
17
+ return g.create({ doc: s.doc, selection: s.selection, extensions: (Array.isArray(s.extensions) ? s.extensions : [s.extensions]).concat([h.updateListener.of((function(n) {
18
+ r(n), n.docChanged && c(n.state.doc.toString(), n), n.focusChanged && (n.view.hasFocus ? m(n) : f(n));
19
+ }))]) });
20
+ }, v = function(t) {
21
+ var r = new A();
22
+ return { compartment: r, run: function(c) {
23
+ r.get(t.state) ? t.dispatch({ effects: r.reconfigure(c) }) : t.dispatch({ effects: I.appendConfig.of(r.of(c)) });
24
+ } };
25
+ }, O = function(t, r) {
26
+ var c = v(t), m = c.compartment, f = c.run;
27
+ return function(s) {
28
+ var n = m.get(t.state);
29
+ f(s ?? n !== r ? r : []);
30
+ };
31
+ }, b = { type: Boolean, default: void 0 }, q = { autofocus: b, disabled: b, indentWithTab: b, tabSize: Number, placeholder: String, style: Object, autoDestroy: b, phrases: Object, root: Object, extensions: Array, selection: Object }, H = { modelValue: { type: String, default: "" } }, J = Object.assign(Object.assign({}, q), H);
32
+ (function(t) {
33
+ t.Change = "change", t.Update = "update", t.Focus = "focus", t.Blur = "blur", t.Ready = "ready", t.ModelUpdate = "update:modelValue";
34
+ })(u || (u = {}));
35
+ var p = {};
36
+ p[u.Change] = function(t, r) {
37
+ return !0;
38
+ }, p[u.Update] = function(t) {
39
+ return !0;
40
+ }, p[u.Focus] = function(t) {
41
+ return !0;
42
+ }, p[u.Blur] = function(t) {
43
+ return !0;
44
+ }, p[u.Ready] = function(t) {
45
+ return !0;
46
+ };
47
+ var j = {};
48
+ j[u.ModelUpdate] = p[u.Change];
49
+ var K = Object.assign(Object.assign({}, p), j), Q = T({ name: "VueCodemirror", props: Object.assign({}, J), emits: Object.assign({}, K), setup: function(t, r) {
50
+ var c = y(), m = y(), f = y(), s = Object.assign(Object.assign({}, G), B(_, {})), n = z((function() {
51
+ var l = {};
52
+ return Object.keys(E(t)).forEach((function(o) {
53
+ var e;
54
+ o !== "modelValue" && (l[o] = (e = t[o]) !== null && e !== void 0 ? e : s[o]);
55
+ })), l;
56
+ }));
57
+ return P((function() {
58
+ var l;
59
+ m.value = $({ doc: t.modelValue, selection: n.value.selection, extensions: (l = s.extensions) !== null && l !== void 0 ? l : [], onFocus: function(e) {
60
+ return r.emit(u.Focus, e);
61
+ }, onBlur: function(e) {
62
+ return r.emit(u.Blur, e);
63
+ }, onUpdate: function(e) {
64
+ return r.emit(u.Update, e);
65
+ }, onChange: function(e, i) {
66
+ e !== t.modelValue && (r.emit(u.Change, e, i), r.emit(u.ModelUpdate, e, i));
67
+ } }), f.value = (function(e) {
68
+ return new h(Object.assign({}, e));
69
+ })({ state: m.value, parent: c.value, root: n.value.root });
70
+ var o = (function(e) {
71
+ var i = function() {
72
+ return e.state.doc.toString();
73
+ }, S = v(e).run, C = O(e, [h.editable.of(!1), g.readOnly.of(!0)]), x = O(e, M.of([L])), U = v(e).run, w = v(e).run, D = v(e).run, F = v(e).run;
74
+ return { focus: function() {
75
+ return e.focus();
76
+ }, getDoc: i, setDoc: function(a) {
77
+ a !== i() && e.dispatch({ changes: { from: 0, to: e.state.doc.length, insert: a } });
78
+ }, reExtensions: S, toggleDisabled: C, toggleIndentWithTab: x, setTabSize: function(a) {
79
+ U([g.tabSize.of(a), N.of(" ".repeat(a))]);
80
+ }, setPhrases: function(a) {
81
+ w([g.phrases.of(a)]);
82
+ }, setPlaceholder: function(a) {
83
+ D(k(a));
84
+ }, setStyle: function(a) {
85
+ a === void 0 && (a = {}), F(h.theme({ "&": Object.assign({}, a) }));
86
+ } };
87
+ })(f.value);
88
+ d((function() {
89
+ return t.modelValue;
90
+ }), (function(e) {
91
+ e !== o.getDoc() && o.setDoc(e);
92
+ })), d((function() {
93
+ return t.extensions;
94
+ }), (function(e) {
95
+ return o.reExtensions(e || []);
96
+ }), { immediate: !0 }), d((function() {
97
+ return n.value.disabled;
98
+ }), (function(e) {
99
+ return o.toggleDisabled(e);
100
+ }), { immediate: !0 }), d((function() {
101
+ return n.value.indentWithTab;
102
+ }), (function(e) {
103
+ return o.toggleIndentWithTab(e);
104
+ }), { immediate: !0 }), d((function() {
105
+ return n.value.tabSize;
106
+ }), (function(e) {
107
+ return o.setTabSize(e);
108
+ }), { immediate: !0 }), d((function() {
109
+ return n.value.phrases;
110
+ }), (function(e) {
111
+ return o.setPhrases(e || {});
112
+ }), { immediate: !0 }), d((function() {
113
+ return n.value.placeholder;
114
+ }), (function(e) {
115
+ return o.setPlaceholder(e);
116
+ }), { immediate: !0 }), d((function() {
117
+ return n.value.style;
118
+ }), (function(e) {
119
+ return o.setStyle(e);
120
+ }), { immediate: !0 }), n.value.autofocus && o.focus(), r.emit(u.Ready, { state: m.value, view: f.value, container: c.value });
121
+ })), V((function() {
122
+ n.value.autoDestroy && f.value && (function(l) {
123
+ l.destroy();
124
+ })(f.value);
125
+ })), function() {
126
+ return W("div", { class: "v-codemirror", style: { display: "contents" }, ref: c });
127
+ };
128
+ } }), oe = Q;
129
+ export {
130
+ oe as Codemirror,
131
+ G as DEFAULT_CONFIG
132
+ };
@@ -0,0 +1,93 @@
1
+ var t = {
2
+ 8: "Backspace",
3
+ 9: "Tab",
4
+ 10: "Enter",
5
+ 12: "NumLock",
6
+ 13: "Enter",
7
+ 16: "Shift",
8
+ 17: "Control",
9
+ 18: "Alt",
10
+ 20: "CapsLock",
11
+ 27: "Escape",
12
+ 32: " ",
13
+ 33: "PageUp",
14
+ 34: "PageDown",
15
+ 35: "End",
16
+ 36: "Home",
17
+ 37: "ArrowLeft",
18
+ 38: "ArrowUp",
19
+ 39: "ArrowRight",
20
+ 40: "ArrowDown",
21
+ 44: "PrintScreen",
22
+ 45: "Insert",
23
+ 46: "Delete",
24
+ 59: ";",
25
+ 61: "=",
26
+ 91: "Meta",
27
+ 92: "Meta",
28
+ 106: "*",
29
+ 107: "+",
30
+ 108: ",",
31
+ 109: "-",
32
+ 110: ".",
33
+ 111: "/",
34
+ 144: "NumLock",
35
+ 145: "ScrollLock",
36
+ 160: "Shift",
37
+ 161: "Shift",
38
+ 162: "Control",
39
+ 163: "Control",
40
+ 164: "Alt",
41
+ 165: "Alt",
42
+ 173: "-",
43
+ 186: ";",
44
+ 187: "=",
45
+ 188: ",",
46
+ 189: "-",
47
+ 190: ".",
48
+ 191: "/",
49
+ 192: "`",
50
+ 219: "[",
51
+ 220: "\\",
52
+ 221: "]",
53
+ 222: "'"
54
+ }, a = {
55
+ 48: ")",
56
+ 49: "!",
57
+ 50: "@",
58
+ 51: "#",
59
+ 52: "$",
60
+ 53: "%",
61
+ 54: "^",
62
+ 55: "&",
63
+ 56: "*",
64
+ 57: "(",
65
+ 59: ":",
66
+ 61: "+",
67
+ 173: "_",
68
+ 186: ":",
69
+ 187: "+",
70
+ 188: "<",
71
+ 189: "_",
72
+ 190: ">",
73
+ 191: "?",
74
+ 192: "~",
75
+ 219: "{",
76
+ 220: "|",
77
+ 221: "}",
78
+ 222: '"'
79
+ }, n = typeof navigator < "u" && /Mac/.test(navigator.platform), y = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
80
+ for (var r = 0; r < 10; r++) t[48 + r] = t[96 + r] = String(r);
81
+ for (var r = 1; r <= 24; r++) t[r + 111] = "F" + r;
82
+ for (var r = 65; r <= 90; r++)
83
+ t[r] = String.fromCharCode(r + 32), a[r] = String.fromCharCode(r);
84
+ for (var i in t) a.hasOwnProperty(i) || (a[i] = t[i]);
85
+ function g(o) {
86
+ var f = n && o.metaKey && o.shiftKey && !o.ctrlKey && !o.altKey || y && o.shiftKey && o.key && o.key.length == 1 || o.key == "Unidentified", e = !f && o.key || (o.shiftKey ? a : t)[o.keyCode] || o.key || "Unidentified";
87
+ return e == "Esc" && (e = "Escape"), e == "Del" && (e = "Delete"), e == "Left" && (e = "ArrowLeft"), e == "Up" && (e = "ArrowUp"), e == "Right" && (e = "ArrowRight"), e == "Down" && (e = "ArrowDown"), e;
88
+ }
89
+ export {
90
+ t as base,
91
+ g as keyName,
92
+ a as shift
93
+ };
@@ -0,0 +1,6 @@
1
+ import { withInstall as o } from "@gsc-basic/utils";
2
+ import t from "./src/index.vue.js";
3
+ const d = o(t);
4
+ export {
5
+ d as GscCodeEditor
6
+ };
@@ -0,0 +1 @@
1
+ .gsc-basic-code-editor[data-v-8fba7df2]{min-width:380px;border:1px solid var(--gsc-basic-border-color);border-radius:var(--gsc-basic-border-radius-base)}.gsc-basic-code-editor__copy-btn[data-v-8fba7df2]{height:20px;padding:0 12px;border:0;background-color:transparent;font-size:12px;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease,opacity .2s ease}.gsc-basic-code-editor__copy-btn[data-v-8fba7df2]:disabled{cursor:not-allowed;opacity:.5}.gsc-basic-code-editor[data-v-8fba7df2] .cm-editor{border:0 solid var(--gsc-basic-border-color);border-width:1px 0}
@@ -0,0 +1,128 @@
1
+ import { computed as d, unref as o, reactive as C, createElementBlock as _, openBlock as V, normalizeClass as B, createVNode as T, createElementVNode as l, normalizeStyle as D, isRef as N, createTextVNode as z, toDisplayString as n } from "vue";
2
+ import { useClipboard as L } from "../../../node_modules/@vueuse/core/dist/index.js";
3
+ import { Codemirror as O } from "../../../node_modules/vue-codemirror/dist/vue-codemirror.esm.js";
4
+ import { oneDark as q } from "../../../node_modules/@codemirror/theme-one-dark/dist/index.js";
5
+ import { json as G, jsonParseLinter as J } from "../../../node_modules/@codemirror/lang-json/dist/index.js";
6
+ import { java as A } from "../../../node_modules/@codemirror/lang-java/dist/index.js";
7
+ import { sql as F } from "../../../node_modules/@codemirror/lang-sql/dist/index.js";
8
+ import { javascript as I } from "../../../node_modules/@codemirror/lang-javascript/dist/index.js";
9
+ import { yaml as M } from "../../../node_modules/@codemirror/lang-yaml/dist/index.js";
10
+ import { xml as P } from "../../../node_modules/@codemirror/lang-xml/dist/index.js";
11
+ import { python as R } from "../../../node_modules/@codemirror/lang-python/dist/index.js";
12
+ import { linter as U, lintGutter as $ } from "../../../node_modules/@codemirror/lint/dist/index.js";
13
+ import { useModelBinding as w } from "@gsc-basic/hooks";
14
+ import { useNamespace as H } from "../../hooks/useNamespace.js";
15
+ import { useLocale as K } from "../../hooks/useLocale.js";
16
+ import './index2.css';import './index.css';/* empty css */
17
+ /* empty css */
18
+ import Q from "../../../_virtual/_plugin-vue_export-helper.js";
19
+ const W = { class: "flex items-center justify-between py-1 text-xs dark:text-gray-200 dark:bg-gray-800" }, X = ["disabled"], Y = { class: "flex" }, Z = { class: "pr-2" }, ee = { class: "pr-2" }, te = { class: "pr-2" }, oe = /* @__PURE__ */ Object.assign({
20
+ name: "GscCodeEditor"
21
+ }, {
22
+ __name: "index",
23
+ props: {
24
+ modelValue: {
25
+ type: [String]
26
+ },
27
+ placeholder: {
28
+ type: String
29
+ },
30
+ editorStyle: {
31
+ type: [Array, String, Object],
32
+ default: () => ({ height: "180px" })
33
+ },
34
+ language: {
35
+ type: String,
36
+ default: "json",
37
+ validator: (s) => ["json", "java", "sql", "yaml", "xml", "python", "javascript"].includes(s)
38
+ },
39
+ isDarkTheme: Boolean,
40
+ disabled: Boolean,
41
+ autofocus: {
42
+ type: Boolean,
43
+ default: !1
44
+ }
45
+ },
46
+ emits: ["change", "update:modelValue"],
47
+ setup(s) {
48
+ const a = s, { prefixCls: p } = H("code-editor"), { t: r } = K(), m = {
49
+ json: () => [G(), U(J()), $()],
50
+ java: () => [A()],
51
+ sql: () => [F()],
52
+ yaml: () => [M()],
53
+ xml: () => [P()],
54
+ python: () => [R()],
55
+ javascript: () => [I({
56
+ jsx: !0,
57
+ typescript: !0
58
+ })]
59
+ }, f = d(() => {
60
+ const e = [...m[a.language]?.() ?? []];
61
+ return a.isDarkTheme && e.push(q), e;
62
+ }), g = d(() => {
63
+ if (a.placeholder)
64
+ return a.placeholder;
65
+ const t = `gsc.codeEditor.placeholder.${a.language}`, e = r(t);
66
+ return e === t ? r("gsc.codeEditor.placeholder.default") : e;
67
+ }), [i, y] = w(a, "modelValue", "update:modelValue");
68
+ try {
69
+ a.language === "json" && y(JSON.stringify(JSON.parse(o(i)), null, 2));
70
+ } catch {
71
+ }
72
+ const h = d(() => {
73
+ const t = o(i);
74
+ return !t || t.length === 0;
75
+ }), {
76
+ copy: b,
77
+ copied: x,
78
+ isSupported: v
79
+ } = L({
80
+ source: i,
81
+ legacy: !0
82
+ }), u = d(() => !v.value || h.value), j = d(() => r(x.value ? "gsc.codeEditor.action.copied" : "gsc.codeEditor.action.copy")), E = () => {
83
+ u.value || b();
84
+ }, c = C({
85
+ lines: null,
86
+ cursor: null,
87
+ length: null
88
+ }), S = (t) => {
89
+ const e = t.state.selection.ranges;
90
+ c.cursor = e[0].anchor, c.length = t.state.doc.length, c.lines = t.state.doc.lines;
91
+ };
92
+ return (t, e) => (V(), _("div", {
93
+ class: B([o(p), s.isDarkTheme ? "dark-bg" : "light-bg"])
94
+ }, [
95
+ T(o(O), {
96
+ modelValue: o(i),
97
+ "onUpdate:modelValue": e[0] || (e[0] = (k) => N(i) ? i.value = k : null),
98
+ placeholder: g.value,
99
+ style: D(s.editorStyle),
100
+ autofocus: s.autofocus,
101
+ "indent-with-tab": !0,
102
+ "tab-size": 2,
103
+ disabled: s.disabled,
104
+ extensions: f.value,
105
+ onUpdate: S
106
+ }, null, 8, ["modelValue", "placeholder", "style", "autofocus", "disabled", "extensions"]),
107
+ l("div", W, [
108
+ l("button", {
109
+ class: "gsc-basic-code-editor__copy-btn dark:text-gray-200",
110
+ type: "button",
111
+ disabled: u.value,
112
+ onClick: E
113
+ }, [
114
+ e[1] || (e[1] = l("i", { class: "i-material-symbols:content-copy-outline" }, null, -1)),
115
+ z(" " + n(j.value), 1)
116
+ ], 8, X),
117
+ l("div", Y, [
118
+ l("span", Z, n(o(r)("gsc.codeEditor.info.length")) + ": " + n(c.length), 1),
119
+ l("span", ee, n(o(r)("gsc.codeEditor.info.lines")) + ": " + n(c.lines), 1),
120
+ l("span", te, n(o(r)("gsc.codeEditor.info.cursor")) + ": " + n(c.cursor), 1)
121
+ ])
122
+ ])
123
+ ], 2));
124
+ }
125
+ }), je = /* @__PURE__ */ Q(oe, [["__scopeId", "data-v-8fba7df2"]]);
126
+ export {
127
+ je as default
128
+ };
@@ -0,0 +1 @@
1
+ [data-v-8fba7df2],[data-v-8fba7df2]:before,[data-v-8fba7df2]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-8fba7df2]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.i-material-symbols\:content-copy-outline[data-v-8fba7df2]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E");-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' vertical-align='-0.125em' display='inline-block' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm0-2h9V4H9zm-4 6q-.825 0-1.412-.587T3 20V6h2v14h11v2zm4-6V4z'/%3E%3C/svg%3E") no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;vertical-align:-.125em;display:inline-block;width:1em;height:1em}.flex[data-v-8fba7df2]{display:flex}.items-center[data-v-8fba7df2]{align-items:center}.justify-between[data-v-8fba7df2]{justify-content:space-between}.border[data-v-8fba7df2]{border-width:1px}.dark .dark\:bg-gray-800[data-v-8fba7df2]{--un-bg-opacity:1;background-color:#1f2937}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:bg-gray-800[data-v-8fba7df2]{background-color:rgb(31 41 55 / var(--un-bg-opacity))}}.py-1[data-v-8fba7df2]{padding-top:.25rem;padding-bottom:.25rem}.pr-2[data-v-8fba7df2]{padding-right:.5rem}.text-xs[data-v-8fba7df2]{font-size:.75rem;line-height:1rem}.dark .dark\:text-gray-200[data-v-8fba7df2]{--un-text-opacity:1;color:#e5e7eb}@supports (color: rgb(0 0 0 / 0)){.dark .dark\:text-gray-200[data-v-8fba7df2]{color:rgb(229 231 235 / var(--un-text-opacity))}}.transition[data-v-8fba7df2]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease[data-v-8fba7df2]{transition-timing-function:cubic-bezier(.4,0,.2,1)}
@@ -0,0 +1,7 @@
1
+ import { withInstall as o } from "@gsc-basic/utils";
2
+ import r from "./src/configProvider.js";
3
+ const f = o(r);
4
+ export {
5
+ f as GscConfigProvider,
6
+ f as default
7
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as i, renderSlot as n } from "vue";
2
+ import { configProviderProps as f } from "./configProviderProps.js";
3
+ import { provideGlobalConfig as t } from "./useGlobalConfig.js";
4
+ const s = i({
5
+ name: "GscConfigProvider",
6
+ props: f,
7
+ setup(o, { slots: r }) {
8
+ const e = t(o);
9
+ return () => n(r, "default", { config: e?.value });
10
+ }
11
+ });
12
+ export {
13
+ s as default
14
+ };
@@ -0,0 +1,22 @@
1
+ import { defaultInitialZIndex as t } from "./constants.js";
2
+ import r from "../../locale/lang/en-US.js";
3
+ const i = {
4
+ locale: {
5
+ type: Object,
6
+ default: () => r
7
+ },
8
+ size: {
9
+ type: String,
10
+ default: "middle",
11
+ validator(e) {
12
+ return ["middle", "small", "large"].includes(e);
13
+ }
14
+ },
15
+ zIndex: {
16
+ type: Number,
17
+ default: t
18
+ }
19
+ };
20
+ export {
21
+ i as configProviderProps
22
+ };
@@ -0,0 +1,9 @@
1
+ const e = /* @__PURE__ */ Symbol("configProviderContextKey"), o = /* @__PURE__ */ Symbol("zIndexContextKey"), t = /* @__PURE__ */ Symbol("sizeInjectionKey"), n = /* @__PURE__ */ Symbol("localeContextKey"), c = "gsc-basic", y = 999;
2
+ export {
3
+ e as configProviderContextKey,
4
+ y as defaultInitialZIndex,
5
+ c as defaultNamespace,
6
+ n as localeContextKey,
7
+ t as sizeInjectionKey,
8
+ o as zIndexContextKey
9
+ };
@@ -0,0 +1,45 @@
1
+ import { getCurrentInstance as a, inject as v, ref as g, computed as n, unref as o, provide as C } from "vue";
2
+ import { deepMerge as m } from "@gsc-basic/utils";
3
+ import { useLocale as x } from "../../hooks/useLocale.js";
4
+ import { configProviderContextKey as d, defaultInitialZIndex as z, localeContextKey as I, zIndexContextKey as b, sizeInjectionKey as G } from "./constants.js";
5
+ const c = g();
6
+ function p(t, e = void 0) {
7
+ const i = a() ? v(d, c) : c;
8
+ return t ? n(() => i.value?.[t] ?? e) : i;
9
+ }
10
+ function F(t) {
11
+ const e = p(), i = x(n(() => e.value?.locale)), u = n(() => o(t) || e.value?.size || "");
12
+ return y(n(() => o(e) || {})), {
13
+ locale: i,
14
+ zIndex: e.value?.zIndex || z,
15
+ size: u
16
+ };
17
+ }
18
+ const y = (t, e, i = !1) => {
19
+ const u = !!a(), f = u ? p() : void 0, l = e?.provide ?? (u ? C : void 0);
20
+ if (!l) {
21
+ console.warn(
22
+ "provideGlobalConfig",
23
+ "provideGlobalConfig() can only be used inside setup()."
24
+ );
25
+ return;
26
+ }
27
+ const r = n(() => {
28
+ const s = o(t);
29
+ return f?.value ? m(f.value, s) : s;
30
+ });
31
+ return l(d, r), l(
32
+ I,
33
+ n(() => o(r).locale)
34
+ ), l(
35
+ b,
36
+ n(() => o(r).zIndex)
37
+ ), l(G, {
38
+ size: n(() => o(r).size || "")
39
+ }), (i || !c.value) && (c.value = o(r)), r;
40
+ };
41
+ export {
42
+ y as provideGlobalConfig,
43
+ F as useGlobalComponentSettings,
44
+ p as useGlobalConfig
45
+ };
@@ -0,0 +1,6 @@
1
+ import { withInstall as e } from "@gsc-basic/utils";
2
+ import r from "./src/index.vue.js";
3
+ const t = e(r);
4
+ export {
5
+ t as GscScaleScreen
6
+ };
@@ -0,0 +1 @@
1
+ .gsc-basic-screen-box[data-v-7eabd167]{overflow:hidden;width:100vw;height:100vh}.gsc-basic-screen-box .screen-wrapper[data-v-7eabd167]{position:relative;overflow:hidden;z-index:100;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transform-origin:left top}
@@ -0,0 +1,115 @@
1
+ import { reactive as y, ref as S, watch as $, onMounted as j, nextTick as w, createElementBlock as v, openBlock as O, normalizeClass as _, normalizeStyle as b, unref as z, createElementVNode as k, renderSlot as N } from "vue";
2
+ import { useWindowSizeFn as B } from "@gsc-basic/hooks";
3
+ import { useNamespace as M } from "../../hooks/useNamespace.js";
4
+ import './index2.css';import './index.css';/* empty css */
5
+ /* empty css */
6
+ import C from "../../../_virtual/_plugin-vue_export-helper.js";
7
+ const E = {
8
+ __name: "index",
9
+ props: {
10
+ width: {
11
+ type: [String, Number],
12
+ default: 1920
13
+ },
14
+ height: {
15
+ type: [String, Number],
16
+ default: 1080
17
+ },
18
+ fullScreen: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ autoScale: {
23
+ type: [Object, Boolean],
24
+ default: !0
25
+ },
26
+ delay: {
27
+ type: Number,
28
+ default: 300
29
+ },
30
+ boxStyle: {
31
+ type: Object,
32
+ default: () => ({})
33
+ },
34
+ wrapperStyle: {
35
+ type: Object,
36
+ default: () => ({})
37
+ }
38
+ },
39
+ setup(s) {
40
+ const i = s, { prefixCls: x } = M("screen-box"), e = y({
41
+ width: 0,
42
+ height: 0,
43
+ originalWidth: 0,
44
+ originalHeight: 0
45
+ }), a = S(null), n = y({}), h = S(null);
46
+ $(
47
+ () => i.autoScale,
48
+ async (t) => {
49
+ t ? m() : W();
50
+ }
51
+ );
52
+ const g = () => new Promise((t) => {
53
+ h.value.scrollLeft = 0, h.value.scrollTop = 0, w(() => {
54
+ i.width && i.height ? (e.width = i.width, e.height = i.height) : (e.width = a.value?.clientWidth, e.height = a.value?.clientHeight), (!e.originalHeight || !e.originalWidth) && (e.originalWidth = window.screen.width, e.originalHeight = window.screen.height), t();
55
+ });
56
+ }), p = () => {
57
+ e.width && e.height ? Object.assign(n, {
58
+ width: `${e.width}px`,
59
+ height: `${e.height}px`
60
+ }) : Object.assign(n, {
61
+ width: `${e.originalWidth}px`,
62
+ height: `${e.originalHeight}px`
63
+ });
64
+ };
65
+ function W() {
66
+ Object.assign(n, {
67
+ margin: "",
68
+ transform: ""
69
+ });
70
+ }
71
+ const H = (t) => {
72
+ if (!i.autoScale)
73
+ return;
74
+ const o = a.value.clientWidth, d = a.value.clientHeight, u = document.body.clientWidth, c = document.body.clientHeight;
75
+ let r = Math.max((u - o * t) / 2, 0), l = Math.max((c - d * t) / 2, 0);
76
+ typeof i.autoScale == "object" && (!i.autoScale.x && (r = 0), !i.autoScale.y && (l = 0)), Object.assign(n, {
77
+ margin: `${l}px ${r}px`,
78
+ transform: `scale(${t},${t})`
79
+ });
80
+ }, f = () => {
81
+ const t = document.body.clientWidth, o = document.body.clientHeight, d = e.width || e.originalWidth, u = e.height || e.originalHeight, c = t / +d, r = o / +u;
82
+ if (i.fullScreen)
83
+ return Object.assign(n, {
84
+ transform: `scale(${c},${r})`
85
+ }), !1;
86
+ const l = Math.min(c, r);
87
+ H(l);
88
+ };
89
+ async function m() {
90
+ await g(), p(), f();
91
+ }
92
+ return B(m, i.delay), j(() => {
93
+ w(async () => {
94
+ await g(), p(), f();
95
+ });
96
+ }), (t, o) => (O(), v("section", {
97
+ ref_key: "box",
98
+ ref: h,
99
+ style: b(s.boxStyle),
100
+ class: _([z(x)])
101
+ }, [
102
+ k("div", {
103
+ ref_key: "screenWrapper",
104
+ ref: a,
105
+ style: b({ ...s.wrapperStyle, ...n }),
106
+ class: "screen-wrapper"
107
+ }, [
108
+ N(t.$slots, "default", {}, void 0, !0)
109
+ ], 4)
110
+ ], 6));
111
+ }
112
+ }, V = /* @__PURE__ */ C(E, [["__scopeId", "data-v-7eabd167"]]);
113
+ export {
114
+ V as default
115
+ };
@@ -0,0 +1 @@
1
+ [data-v-7eabd167],[data-v-7eabd167]:before,[data-v-7eabd167]:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }[data-v-7eabd167]::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.relative[data-v-7eabd167]{position:relative}.mx[data-v-7eabd167]{margin-left:1rem;margin-right:1rem}.my[data-v-7eabd167]{margin-top:1rem;margin-bottom:1rem}.hidden[data-v-7eabd167]{display:none}.transform[data-v-7eabd167]{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.px[data-v-7eabd167]{padding-left:1rem;padding-right:1rem}
@@ -0,0 +1,6 @@
1
+ import { withInstall as o } from "@gsc-basic/utils";
2
+ import r from "./src/index.vue.js";
3
+ const c = o(r);
4
+ export {
5
+ c as GscVideoBackground
6
+ };
@@ -0,0 +1,29 @@
1
+ function t(e, o) {
2
+ if (typeof e > "u")
3
+ throw new TypeError(`${o} requires a video selector as first argument.`);
4
+ if (e = typeof e == "string" ? document.querySelector(e) : e, e.nodeName.toLowerCase() !== "video")
5
+ throw new Error(
6
+ `${o} requires a valid video selector. You passed a <${e.nodeName}>`
7
+ );
8
+ return e;
9
+ }
10
+ function i() {
11
+ const e = {
12
+ touch: !!("ontouchstart" in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch),
13
+ ie: window.navigator.userAgent.indexOf("MSIE") > 0 || !!window.navigator.userAgent.match(/Trident.*rv:11\./),
14
+ small: window.matchMedia("(max-width: 34em)").matches
15
+ };
16
+ return e.touch && !e.ie || e.small;
17
+ }
18
+ let n = null;
19
+ const r = (e) => {
20
+ document.body.contains(e) || n?.insertAdjacentElement("afterbegin", e);
21
+ }, a = (e) => {
22
+ n === null && (n = e.parentNode), document.body.contains(e) && n.removeChild(e);
23
+ };
24
+ export {
25
+ i as detectTouchOrSmallScreen,
26
+ a as removeVideo,
27
+ r as restoreVideo,
28
+ t as validateSelector
29
+ };
@@ -0,0 +1 @@
1
+ .gsc-basic-video-bg-ready .gsc-basic-video-bg .bg-cover{display:none}.gsc-basic-video-bg-ready .gsc-basic-video-bg-video{display:block!important}