@web-utils/component 4.0.11 → 4.0.12

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.
@@ -218,7 +218,7 @@ var p = function() {
218
218
  }, proxy: !0 }, { key: "suffix", fn: function() {
219
219
  return [e._t("suffix")];
220
220
  }, proxy: !0 }], null, !0) })], 1);
221
- }, c = [], d = /* @__PURE__ */ o(
221
+ }, c = [], h = /* @__PURE__ */ o(
222
222
  l,
223
223
  p,
224
224
  c,
@@ -226,7 +226,7 @@ var p = function() {
226
226
  null,
227
227
  null
228
228
  );
229
- const b = d.exports;
229
+ const b = h.exports;
230
230
  export {
231
231
  b as default
232
232
  };
@@ -1,207 +1,7 @@
1
- import * as i from "monaco-editor/esm/vs/editor/editor.api";
2
- import { c as d } from "../chunks/json-beautifier.Bp3GslGm.mjs";
3
- import { NOOP as r } from "@web-utils/core";
4
- import { n as h } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
- const a = {
6
- name: "MonacoEditor",
7
- props: {
8
- diffEditor: { type: Boolean, default: !1 },
9
- // 是否使用 diff 模式
10
- width: { type: [String, Number], default: "100%" },
11
- height: { type: [String, Number], default: "100%" },
12
- original: String,
13
- // 只有在 diff 模式下有效
14
- value: [String, Object],
15
- language: { type: String, default: "javascript" },
16
- theme: { type: String, default: "vs" },
17
- readOnly: { type: Boolean, default: !1 },
18
- options: {
19
- type: Object,
20
- default() {
21
- return {};
22
- }
23
- },
24
- editorMounted: { type: Function, default: r },
25
- editorBeforeMount: { type: Function, default: r },
26
- keyIndex: { type: String }
27
- },
28
- data() {
29
- return {
30
- fullscreen: !1
31
- };
32
- },
33
- computed: {
34
- style() {
35
- return this.fullscreen ? {} : {
36
- width: /^\d+$/.test(this.width) ? `${this.width}px` : this.width,
37
- height: /^\d+$/.test(this.height) ? `${this.height}px` : this.height,
38
- position: "relative"
39
- };
40
- }
41
- },
42
- watch: {
43
- options: {
44
- deep: !0,
45
- handler(e) {
46
- var t;
47
- (t = this.editor) == null || t.updateOptions(e);
48
- }
49
- },
50
- keyIndex() {
51
- let e = this.value;
52
- typeof e == "object" && (e = d(e)), this.editor && e !== this._getValue() && this._setValue(e);
53
- },
54
- language() {
55
- if (this.editor)
56
- if (this.diffEditor) {
57
- const { original: e, modified: t } = this.editor.getModel();
58
- i.editor.setModelLanguage(e, this.language), i.editor.setModelLanguage(t, this.language);
59
- } else
60
- i.editor.setModelLanguage(this.editor.getModel(), this.language);
61
- },
62
- theme() {
63
- this.editor && i.editor.setTheme(this.theme);
64
- },
65
- style() {
66
- this.$nextTick(() => {
67
- var e;
68
- (e = this.editor) == null || e.layout();
69
- });
70
- },
71
- value(e) {
72
- this.editor && e !== this._getValue() && this._setValue(e);
73
- }
74
- },
75
- mounted() {
76
- this.initMonaco(), window.addEventListener("resize", this.onResize);
77
- },
78
- beforeDestroy() {
79
- var e;
80
- window.removeEventListener("resize", this.onResize), (e = this.editor) == null || e.dispose();
81
- },
82
- methods: {
83
- initMonaco() {
84
- const { value: e, language: t, theme: o, readOnly: n, options: s } = this;
85
- Object.assign(s, this._editorBeforeMount()), this.editor = i.editor[this.diffEditor ? "createDiffEditor" : "create"](this.$el, {
86
- value: typeof e == "string" ? e : d(e),
87
- language: t,
88
- theme: o,
89
- readOnly: n,
90
- ...s
91
- }), this.diffEditor && this._setModel(this.value, this.original), this._editorMounted(this.editor), this.editor.addAction({
92
- id: "f1",
93
- label: "full screen",
94
- keybindings: [i.KeyCode.F1],
95
- run: (l) => {
96
- this.toggleFullScreen();
97
- }
98
- }), this.editor.addAction({
99
- id: "escape",
100
- label: "exit full screen",
101
- keybindings: [i.KeyCode.Escape],
102
- run: (l) => {
103
- this.fullscreen = !1;
104
- }
105
- });
106
- },
107
- toggleFullScreen() {
108
- this.fullscreen = !this.fullscreen;
109
- },
110
- async onResize() {
111
- await this.$nextTick();
112
- const e = this.$el;
113
- this.editor.layout({
114
- width: e.clientWidth,
115
- height: e.clientHeight
116
- });
117
- },
118
- _handleFullScreen() {
119
- this.isMaximum ? this.minEditor() : this.maxEditor();
120
- },
121
- // 放大
122
- maxEditor() {
123
- this.isMaximum = !0;
124
- const e = this.$el;
125
- this.originSize = {
126
- width: e.clientWidth,
127
- height: e.clientHeight
128
- }, e.classList.add("editor-fullscreen"), this.editor.layout({
129
- height: document.body.clientHeight,
130
- width: document.body.clientWidth
131
- }), document.addEventListener("keyup", this.handleEsc);
132
- },
133
- handleEsc(e) {
134
- e.keyCode === 27 && this.minEditor();
135
- },
136
- // 缩小
137
- minEditor() {
138
- this.isMaximum = !1, this.$el.classList.remove("editor-fullscreen"), this.editor.layout({
139
- height: this.originSize.height,
140
- width: this.originSize.width
141
- }), document.removeEventListener("keyup", this.handleEsc);
142
- },
143
- _getEditor() {
144
- return this.editor ? this.diffEditor ? this.editor.modifiedEditor : this.editor : null;
145
- },
146
- _setModel(e, t) {
147
- const { language: o } = this, n = i.editor.createModel(t, o), s = i.editor.createModel(e, o);
148
- this.editor.setModel({
149
- original: n,
150
- modified: s
151
- });
152
- },
153
- _setValue(e) {
154
- const t = this._getEditor();
155
- if (t) return t.setValue(e);
156
- },
157
- _getValue() {
158
- const e = this._getEditor();
159
- return e ? e.getValue() : "";
160
- },
161
- _editorBeforeMount() {
162
- return this.editorBeforeMount(i) || {};
163
- },
164
- _editorMounted(e) {
165
- this.editorMounted(e, i), this.diffEditor ? e.onDidUpdateDiff((t) => {
166
- const o = this._getValue();
167
- this._emitChange(o, t);
168
- }) : e.onDidChangeModelContent((t) => {
169
- const o = this._getValue();
170
- this._emitChange(o, t);
171
- });
172
- },
173
- _emitChange(e, t) {
174
- this.$emit("change", e, t), this.$emit("input", e);
175
- }
176
- },
177
- render(e) {
178
- const t = this.options.fullScreen;
179
- return e("div", { class: ["monaco_editor_container", this.fullscreen ? "fullscreen" : ""], style: this.style }, [
180
- t ? e("i", {
181
- class: "el-icon-full-screen",
182
- style: {
183
- width: "1.2em",
184
- height: "1.2em",
185
- position: "absolute",
186
- left: "0px",
187
- top: "0px",
188
- zIndex: "1",
189
- cursor: "pointer"
190
- },
191
- on: { click: this._handleFullScreen }
192
- }) : ""
193
- ]);
194
- }
195
- }, u = null, c = null;
196
- var f = /* @__PURE__ */ h(
197
- a,
198
- u,
199
- c,
200
- !1,
201
- null,
202
- null
203
- );
204
- const y = f.exports;
1
+ import "monaco-editor/esm/vs/editor/editor.api";
2
+ import { M as i } from "../chunks/MonacoEditor.D31t4FTy.mjs";
3
+ import "@web-utils/core";
4
+ import "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
205
5
  export {
206
- y as default
6
+ i as default
207
7
  };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
3
  "description": "Web Components",
4
- "version": "4.0.11",
4
+ "version": "4.0.12",
5
5
  "author": "Simple",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "./index.mjs",
9
9
  "module": "./index.mjs",
10
+ "types": "",
10
11
  "web-types": "web-types.json",
11
12
  "sideEffects": [
12
13
  "*.css",
@@ -17,9 +18,9 @@
17
18
  "@tinymce/tinymce-vue": "3.2.8",
18
19
  "@wangeditor/editor": "^5.1.23",
19
20
  "@wangeditor/editor-for-vue": "^1.0.2",
20
- "@web-utils/core": "^5.0.3",
21
- "@web-utils/integrations": "^5.0.3",
22
- "@web-utils/vue": "^5.0.3",
21
+ "@web-utils/core": "^5.0.4",
22
+ "@web-utils/integrations": "^5.0.4",
23
+ "@web-utils/vue": "^5.0.4",
23
24
  "async-validator": "1.8.5",
24
25
  "bpmn-js": "^18.13.1",
25
26
  "bpmn-js-token-simulation": "^0.39.3",
@@ -2,7 +2,7 @@ import { copy as v, hasOwn as P } from "@web-utils/core";
2
2
  import S from "element-ui/lib/message";
3
3
  import { g as _, f as C, i as B, j as A } from "../chunks/index.B2TRddqf.mjs";
4
4
  import { merge as f } from "@web-utils/integrations/lodash";
5
- import { g as K } from "../chunks/dictionary.3O-Io7Vh.mjs";
5
+ import { g as K } from "../chunks/dictionary.DGt59Ir7.mjs";
6
6
  import { _ as T } from "../chunks/helper.BiMLcEEk.mjs";
7
7
  import "vue";
8
8
  import { n as b } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
@@ -0,0 +1,4 @@
1
+ export declare function initPhotoSwipe(options: any): void;
2
+ export declare function photoswipe(event: any, thumbnailsWrapperDom: any, options?: {
3
+ selector: string;
4
+ }): Promise<void>;
@@ -1,8 +1,8 @@
1
1
  import { _ as T } from "../chunks/helper.BiMLcEEk.mjs";
2
2
  import { h as d } from "vue";
3
- import { g as C } from "../chunks/dictionary.3O-Io7Vh.mjs";
3
+ import { g as C } from "../chunks/dictionary.DGt59Ir7.mjs";
4
4
  import { n as B } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
- import { f as V } from "../chunks/core.DJEgjQW6.mjs";
5
+ import { f as V } from "../chunks/core.0Exl13Mz.mjs";
6
6
  const D = {
7
7
  name: "DictRender",
8
8
  inheritAttrs: !1,
@@ -2,8 +2,8 @@ import { isFunction as p, toStringArray as f, isString as o, isArray as c, trace
2
2
  import { merge as i } from "@web-utils/integrations/lodash";
3
3
  import { g as m, h as w } from "../chunks/index.B2TRddqf.mjs";
4
4
  import g from "../form-item-config-provider/index.mjs";
5
- import { a as v, p as _ } from "../chunks/configComponents.CpKi15WN.mjs";
6
- import { b as a } from "../chunks/core.DJEgjQW6.mjs";
5
+ import { reloadTable as v, processButtons as _ } from "../configComponents.mjs";
6
+ import { t as a } from "../chunks/core.0Exl13Mz.mjs";
7
7
  import y from "element-ui/lib/transitions/collapse-transition";
8
8
  import { n as S } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
9
9
  const T = [
@@ -1,6 +1,6 @@
1
1
  import { toStringArray as a } from "@web-utils/core";
2
2
  import { merge as n } from "@web-utils/integrations/lodash";
3
- import { p as l } from "../chunks/configComponents.CpKi15WN.mjs";
3
+ import { processButtons as l } from "../configComponents.mjs";
4
4
  import { n as i } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
5
  const u = [
6
6
  "back",
package/toolbar/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { h as p } from "vue";
2
2
  import { copy as m, NOOP as d } from "@web-utils/core";
3
- import { h as y, b as g } from "../chunks/configComponents.CpKi15WN.mjs";
3
+ import { hasAuthority as y, goBack as g } from "../configComponents.mjs";
4
4
  import { n as B } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
5
  const u = {
6
6
  back: {
@@ -1,5 +1,5 @@
1
1
  import { isFunction as n, isArray as r } from "@web-utils/core";
2
- import { h as a } from "../chunks/configComponents.CpKi15WN.mjs";
2
+ import { hasAuthority as a } from "../configComponents.mjs";
3
3
  import { n as l } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
4
4
  const s = {
5
5
  name: "ToolbarButton",
@@ -0,0 +1,10 @@
1
+ export default class RecordVideo {
2
+ private video;
3
+ private mediaRecorder;
4
+ private chunks;
5
+ constructor(videoObj: HTMLVideoElement);
6
+ init(): Promise<unknown>;
7
+ startRecord(): void;
8
+ stopRecord(): void;
9
+ isSupport(): true | undefined;
10
+ }
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@web-utils/component",
5
- "version": "4.0.11",
5
+ "version": "4.0.12",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "description-markup": "markdown",
@@ -1,123 +0,0 @@
1
- const g = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, O = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
2
- let s, p;
3
- const d = {
4
- // table of character substitutions
5
- "\b": "\\b",
6
- " ": "\\t",
7
- "\n": "\\n",
8
- "\f": "\\f",
9
- "\r": "\\r",
10
- '"': '\\"',
11
- "'": "\\'",
12
- "\\": "\\\\"
13
- };
14
- let h;
15
- function N(r, i = {}) {
16
- const n = i.space || 2, t = i.dropQuotesOnKeys !== !1, e = i.dropQuotesOnNumbers || !1, l = i.inlineShortArrays || !1, o = i.inlineShortArraysDepth || 1, a = i.quoteType || "single", c = i.minify || !1;
17
- e && S(r);
18
- let u = x(r, null, c ? void 0 : n, t, a);
19
- if (l && !c) {
20
- let f = j(u);
21
- if (o > 1)
22
- for (let m = 1; m < o && (u = f, f = j(u), f !== u); m++)
23
- ;
24
- u = f;
25
- }
26
- return u;
27
- }
28
- function S(r) {
29
- if (!$(r)) return;
30
- const i = Object.keys(r);
31
- i && i.forEach(function(n) {
32
- const t = r[n];
33
- if (typeof t == "string") {
34
- const e = t - 0;
35
- r[n] = isNaN(e) ? t : e;
36
- } else ($(t) || Array.isArray(t)) && S(t);
37
- });
38
- }
39
- function $(r) {
40
- return r && typeof r == "object";
41
- }
42
- function j(r, i) {
43
- if (i || (i = 80), typeof i != "number" || i < 20)
44
- throw Error(`Invalid width '${i}'. Expecting number equal or larger than 20.`);
45
- const n = r.split(`
46
- `);
47
- let t = 0, e = null, l = [];
48
- for (; t < n.length; ) {
49
- const o = !!n[t].match(/\[/), a = !!n[t].match(/\],?/);
50
- if (o && !a)
51
- l = [n[t]], e = t;
52
- else if (a && !o && e) {
53
- l.push((n[t] || "").trim());
54
- const c = l.join(" ");
55
- c.length < i && (n.splice(e, t - e + 1, c), t = e), e = null, l = [];
56
- } else
57
- e && l.push((n[t] || "").trim());
58
- t += 1;
59
- }
60
- return n.join(`
61
- `);
62
- }
63
- function x(r, i, n, t, e) {
64
- let l;
65
- if (s = "", p = "", typeof n == "number")
66
- for (l = 0; l < n; l += 1)
67
- p += " ";
68
- else typeof n == "string" && (p = n);
69
- return h = i, b("", { "": r }, t, e);
70
- }
71
- function b(r, i, n, t) {
72
- let e, l, o, a;
73
- const c = s;
74
- let u, f = i[r];
75
- switch (f && typeof f == "object" && typeof f.toJSON == "function" && (f = f.toJSON(r)), typeof h == "function" && (f = h.call(i, r, f)), typeof f) {
76
- case "function":
77
- return f;
78
- case "string":
79
- return y(f, t);
80
- case "number":
81
- return isFinite(f) ? String(f) : "null";
82
- case "boolean":
83
- case "null":
84
- return String(f);
85
- // If the type is 'object', we might be dealing with an object or an array or
86
- // null.
87
- case "object":
88
- if (!f)
89
- return "null";
90
- if (s += p, u = [], Object.prototype.toString.apply(f) === "[object Array]") {
91
- for (a = f.length, e = 0; e < a; e += 1)
92
- u[e] = b(e, f, n, t) || "null";
93
- return o = u.length === 0 ? "[]" : s ? `[
94
- ${s}${u.join(`,
95
- ${s}`)}
96
- ${c}]` : `[${u.join(",")}]`, s = c, o;
97
- }
98
- if (h && typeof h == "object")
99
- for (a = h.length, e = 0; e < a; e += 1)
100
- typeof h[e] == "string" && (l = h[e], o = b(l, f, n, t), o && u.push((n ? A(l, t) : y(l, t)) + (s ? ": " : ":") + o));
101
- else
102
- for (l in f)
103
- Object.prototype.hasOwnProperty.call(f, l) && (o = b(l, f, n, t), o && u.push((n ? A(l, t) : y(l, t)) + (s ? ": " : ":") + o));
104
- return o = u.length === 0 ? "{}" : s ? `{
105
- ${s}${u.join(`,
106
- ${s}`)}
107
- ${c}}` : `{${u.join(",")}}`, s = c, o;
108
- }
109
- }
110
- function y(r, i) {
111
- g.lastIndex = 0;
112
- let n = '"';
113
- return i === "single" && (n = "'"), g.test(r) ? n + r.replace(g, function(t) {
114
- const e = d[t];
115
- return typeof e == "string" ? e : `\\u${`0000${t.charCodeAt(0).toString(16)}`.slice(-4)}`;
116
- }) + n : n + r + n;
117
- }
118
- function A(r, i) {
119
- return O.test(r) ? r : y(r, i);
120
- }
121
- export {
122
- N as c
123
- };