x-block-lib 0.10.39 → 0.11.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/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as ee,L as d,M as f,N as te,O as ne,P as re,Q as ie,R as ae,S as p,T as m,U as oe,V as h,W as se,X as ce,Y as g,Z as le,_,a as ue,b as de,c as fe,d as pe,f as me,g as he,h as ge,i as _e,j as v,k as ve,l as ye,m as y,n as be,o as xe,p as Se,q as b,r as Ce,s as we,u as Te,v as x,w as Ee,x as De,y as S,z as Oe}from"./vendor.
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as ee,L as d,M as f,N as te,O as ne,P as re,Q as ie,R as ae,S as p,T as m,U as oe,V as h,W as se,X as ce,Y as g,Z as le,_,a as ue,b as de,c as fe,d as pe,f as me,g as he,h as ge,i as _e,j as v,k as ve,l as ye,m as y,n as be,o as xe,p as Se,q as b,r as Ce,s as we,u as Te,v as x,w as Ee,x as De,y as S,z as Oe}from"./vendor.g11x21ec.js";import{eventBus as ke,globalObjects as Ae,messageWarning as je,openConfirmDlg as Me,openPromptDlg as Ne,useColor as Pe,useSystem as Fe,useViewStack as Ie}from"x-essential-lib";import{globalState as C}from"x-state-lib";import{addIndent as Le,finalProperties as w,getElement as T,getImplementMethodName as Re,getItems as ze,getTag as Be,getTypes as Ve,makeEventId as E,makeEventKeyOfCustomSlot as He,makeEventKeyOfElementSlot as Ue,makeMethodId as We,makeMethodKeyOfCustomSlot as Ge,makeMethodKeyOfElementSlot as Ke,makePropertyId as qe,makePropertyKeyOfCustomSlot as Je,makePropertyKeyOfElementSlot as Ye,makeTriggerId as Xe,parseNumberUnit as Ze,pkgs as Qe,themeColors as $e,toEventName as et,toMethodName as tt,toPropertyName as nt,unwrapEventId as rt,unwrapEventKeyOfCustomSlot as it,unwrapEventKeyOfElementSlot as at,unwrapMethodId as ot,unwrapMethodKeyOfCustomSlot as st,unwrapMethodKeyOfElementSlot as ct,unwrapPropertyId as lt,unwrapPropertyKeyOfCustomSlot as ut,unwrapPropertyKeyOfElementSlot as dt,unwrapSlotId as ft}from"x-runtime-lib";import{Fragment as pt,computed as D,createBlock as mt,createCommentVNode as ht,createElementBlock as O,createElementVNode as k,createVNode as A,defineComponent as gt,inject as _t,isRef as vt,mergeModels as yt,mergeProps as bt,nextTick as xt,normalizeStyle as j,onBeforeUnmount as St,onMounted as Ct,onUnmounted as wt,openBlock as M,provide as Tt,ref as Et,renderList as Dt,renderSlot as Ot,resolveComponent as N,resolveDirective as kt,toDisplayString as At,unref as P,useId as jt,useModel as Mt,useTemplateRef as Nt,watch as Pt,withCtx as Ft,withDirectives as It,withKeys as Lt,withModifiers as Rt}from"vue";import{useI18n as zt}from"vue-i18n";import{useDisplay as Bt}from"vuetify";async function Vt(e){if(e===`en`)ce((await import(`./en.md0q5xx8.js`)).default);else if(e===`zhHans`)ce((await import(`./zhHans.ei0ea10m.js`)).default);else throw Error(`invalid locale=${e}`)}function F(e){return t[e]??e}function Ht(t){let n=`<block type="text_v1"><field name="TEXT">${t}</field></block>`;return e.xml.textToDom(n)}function Ut(t){let n=`<block type="math_number_v1"><field name="NUM">${t}</field></block>`;return e.xml.textToDom(n)}function Wt(t){let n=`<block type="logic_boolean_v1"><field name="BOOL">${t?`TRUE`:`FALSE`}</field></block>`;return e.xml.textToDom(n)}function Gt(e,t){let n=null;return t===`string`?n=Ht(``):t===`integer`||t===`decimal`?n=Ut(0):t===`boolean`?n=Wt(!1):t===`enum`||t===`dateTime`?n=Ht(``):console.assert(!1,`type not implementd`),n?Oe.domToBlock(n,e):null}const Kt=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==`,qt=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K`;function Jt(e){let t=e.lastIndexOf(`V`);if(t<=0||t>=e.length-1)throw Error(`must has V`);return`${me(e.substring(0,t))}_${`v`+e.substring(t+1)}`}function Yt(e){let t=e.lastIndexOf(`V`);if(t<=0||t>=e.length-1)return console.assert(!1,`invalid key=${e}`),``;let n=e.substring(0,t-1);return`${n[0].toUpperCase()}${n.substring(1)}`}function I(e){return e.length<=0&&e.push([F(`NO_OPTION`),``]),e}function Xt(e){let t=0;for(;e;)t++,e=e.getParent();return t}function Zt(e){return e.ui===`text`?`string`:e.ui===`number`?`number`:e.ui===`switch`?`boolean`:`string`}function Qt(e,t){return!!(e.startsWith(`basic.`)||!t.ui||t.readonly)}function L(e){return e.startsWith(`globality_v`)}function $t(e){return e.startsWith(`ref_v`)}function en(e){return e.startsWith(`multiple_ref_v`)}function R(e){return e.startsWith(`slot_v`)}function z(e){return e.startsWith(`multiple_slot_v`)}function tn(e,t,n){let{kind:r,mainKey:i,slotKey:a}=ft(e);return!(r!==`elementSlot`&&r!==`multipleElementSlot`||t!==i||n!==a)}function nn(e,t,n){let{kind:r,mainKey:i,slotKey:a}=ft(e);return!(r!==`customSlot`&&r!==`multipleCustomSlot`||t!==i||n!==a)}function B(e){return e===`string`?`String`:e===`number`?`Number`:e===`boolean`?`Boolean`:e===`array`?`Array`:e===`object`?`Object`:(e===`any`||console.assert(!1),null)}function rn(e){return e.array?`Array`:e.ui===`transient`?B(e.type):e.ui===`dummy`?null:e.ui===`text`?`String`:e.ui===`number`?`Number`:e.ui===`switch`?`Boolean`:e.ui===`select`?Yt(e.items):e.ui===`multiTypes`?Yt(e.types):e.ui===`comp`?`Comp`:e.ui===`slot`?`Slot`:e.ui===`adaptSlot`?`AdaptSlot`:(console.assert(!1),null)}function an(e){return e===`string`?`String`:e===`integer`||e===`decimal`?`Number`:e===`boolean`?`Boolean`:e===`enum`||e===`dateTime`?`String`:(console.assert(!1),null)}const on=`#F44336.#FFEBEE.#FFCDD2.#EF9A9A.#E57373.#EF5350.#E53935.#D32F2F.#C62828.#B71C1C.#FF8A80.#FF5252.#FF1744.#D50000.#e91e63.#fce4ec.#f8bbd0.#f48fb1.#f06292.#ec407a.#d81b60.#c2185b.#ad1457.#880e4f.#ff80ab.#ff4081.#f50057.#c51162.#9c27b0.#f3e5f5.#e1bee7.#ce93d8.#ba68c8.#ab47bc.#8e24aa.#7b1fa2.#6a1b9a.#4a148c.#ea80fc.#e040fb.#d500f9.#aa00ff.#673ab7.#ede7f6.#d1c4e9.#b39ddb.#9575cd.#7e57c2.#5e35b1.#512da8.#4527a0.#311b92.#b388ff.#7c4dff.#651fff.#6200ea.#3f51b5.#e8eaf6.#c5cae9.#9fa8da.#7986cb.#5c6bc0.#3949ab.#303f9f.#283593.#1a237e.#8c9eff.#536dfe.#3d5afe.#304ffe.#2196F3.#E3F2FD.#BBDEFB.#90CAF9.#64B5F6.#42A5F5.#1E88E5.#1976D2.#1565C0.#0D47A1.#82B1FF.#448AFF.#2979FF.#2962FF.#03a9f4.#e1f5fe.#b3e5fc.#81d4fa.#4fc3f7.#29b6f6.#039be5.#0288d1.#0277bd.#01579b.#80d8ff.#40c4ff.#00b0ff.#0091ea.#00bcd4.#e0f7fa.#b2ebf2.#80deea.#4dd0e1.#26c6da.#00acc1.#0097a7.#00838f.#006064.#84ffff.#18ffff.#00e5ff.#00b8d4.#009688.#e0f2f1.#b2dfdb.#80cbc4.#4db6ac.#26a69a.#00897b.#00796b.#00695c.#004d40.#a7ffeb.#64ffda.#1de9b6.#00bfa5.#4CAF50.#E8F5E9.#C8E6C9.#A5D6A7.#81C784.#66BB6A.#43A047.#388E3C.#2E7D32.#1B5E20.#B9F6CA.#69F0AE.#00E676.#00C853.#8bc34a.#f1f8e9.#dcedc8.#c5e1a5.#aed581.#9ccc65.#7cb342.#689f38.#558b2f.#33691e.#ccff90.#b2ff59.#76ff03.#64dd17.#cddc39.#f9fbe7.#f0f4c3.#e6ee9c.#dce775.#d4e157.#c0ca33.#afb42b.#9e9d24.#827717.#f4ff81.#eeff41.#c6ff00.#aeea00.#ffeb3b.#fffde7.#fff9c4.#fff59d.#fff176.#ffee58.#fdd835.#fbc02d.#f9a825.#f57f17.#ffff8d.#ffff00.#ffea00.#ffd600.#ffc107.#fff8e1.#ffecb3.#ffe082.#ffd54f.#ffca28.#ffb300.#ffa000.#ff8f00.#ff6f00.#ffe57f.#ffd740.#ffc400.#ffab00.#ff9800.#fff3e0.#ffe0b2.#ffcc80.#ffb74d.#ffa726.#fb8c00.#f57c00.#ef6c00.#e65100.#ffd180.#ffab40.#ff9100.#ff6d00.#ff5722.#fbe9e7.#ffccbc.#ffab91.#ff8a65.#ff7043.#f4511e.#e64a19.#d84315.#bf360c.#ff9e80.#ff6e40.#ff3d00.#dd2c00.#795548.#efebe9.#d7ccc8.#bcaaa4.#a1887f.#8d6e63.#6d4c41.#5d4037.#4e342e.#3e2723.#.#.#.#.#607d8b.#eceff1.#cfd8dc.#b0bec5.#90a4ae.#78909c.#546e7a.#455a64.#37474f.#263238.#.#.#.#.#9e9e9e.#fafafa.#f5f5f5.#eeeeee.#e0e0e0.#bdbdbd.#757575.#616161.#424242.#212121.#.#.#.#.#000000.#FFFFFF.#FFFFFF00`.split(`.`),sn=[`add_data_v`,`call_app_method_v`,`call_func_v`,`call_func_internal_v`,`delete_data_v`,`func_entry_v`,`implement_app_method_v`,`open_confirm_dlg_v`,`open_prompt_dlg_v`,`on_app_event_v`,`procedure_def_v`,`transaction_v`,`query_data_v`,`update_data_v`];function cn(e){return!!sn.find(t=>e.startsWith(t))}const ln=e.xml;S.parameter_v1={init:function(){this.key=``,this.name=``,this.locale=!1,this.appendDummyInput().appendField(``,`LABEL`),this.setOutput(!0),this.setColour(220)},mutationToDom:function(){let e=ln.createElement(`mutation`);return e.setAttribute(`key`,this.key),e.setAttribute(`name`,this.name),e.setAttribute(`locale`,this.locale?`TRUE`:`FALSE`),e},domToMutation:function(e){this.key=e.getAttribute(`key`)??``,this.name=e.getAttribute(`name`)??``,this.locale=e.getAttribute(`locale`)===`TRUE`,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},saveExtraState:function(){return{key:this.key,name:this.name,locale:this.locale}},loadExtraState:function(e){this.key=e.key??``,this.name=e.name??``,this.locale=e.locale??!1,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},setKeyName:function(e,t,n){this.key=e,this.name=t,this.locale=n,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},onchange:function(e){if(e.type===p.BLOCK_MOVE){let t=e;if(t.blockId!==this.id)return;this.tryDuplicate_(t)}setTimeout(()=>{this.checkWarning_()},0)},tryDuplicate_:function(e){let t=this.workspace.getBlockById(e.oldParentId);if(t&&cn(t.type))try{p.disable();let n=t.getInput(e.oldInputName)?.connection;if(n){let e=un(this.workspace,this.key,this.name,this.locale);n.connect(e.outputConnection)}}finally{p.enable()}},updateShape_:function(){if(this.locale){let{i18n:e}=Ae;this.setFieldValue(e.global.t(this.name),`LABEL`)}else this.setFieldValue(this.name,`LABEL`)},checkWarning_:function(){let e=this.getSurroundParent();for(;e;){if(cn(e.type))for(let t of e.inputList){let e=t.connection?.targetBlock();if(!e||e.type!==`parameter_v1`)continue;let n=e;if(n.key===this.key){n.name!==this.name&&(this.name=n.name),n.locale!==this.locale&&(this.locale=n.locale),this.setWarningText(null);return}}e=e.getSurroundParent()}this.setWarningText(F(`WARN_PARAMETER_NOT_FOUND`))}},x.forBlock.parameter_v1=function(e){return[e.key,_.ATOMIC]};function un(t,n,r,i){let a=`
|
|
2
2
|
<block type="parameter_v1">
|
|
3
3
|
<mutation key="${n}" name="${r}" locale="${i?`TRUE`:`FALSE`}"/>
|
|
4
4
|
</block>
|
|
@@ -2157,4 +2157,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
2157
2157
|
* Copyright 2021 Google LLC
|
|
2158
2158
|
* SPDX-License-Identifier: Apache-2.0
|
|
2159
2159
|
*/
|
|
2160
|
-
var cp=[
|
|
2160
|
+
var cp=[651,()=>[lp,lp],[``,``,``,``]],lp=[652,()=>[cp,cp],[``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``]];export{Rn as $,Xe as A,Qt as B,Ce as C,De as D,C as E,_t as F,fn as G,nn as H,yt as I,An as J,pn as K,Pt as L,at as M,dt as N,Ae as O,ft as P,Fn as Q,Ht as R,Se as S,Ee as T,cn as U,tn as V,ln as W,Nn as X,Mn as Y,Pn as Z,Hn as _,Yf as a,me as b,Wl as c,Fl as d,Pl as f,As as g,qs as h,Xf as i,Qe as j,je as k,Ul as l,kc as m,sp as n,qf as o,Rc as p,mn as q,Qf as r,Zl as s,lp as t,z as u,Un as v,Te as w,ge as x,re as y,Ut as z};
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
7
|
"type": "module",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./style.css": "./dist/style.css"
|
|
13
|
+
},
|
|
10
14
|
"scripts": {
|
|
11
15
|
"play": "vite",
|
|
12
16
|
"test": "vitest",
|
|
@@ -16,11 +20,6 @@
|
|
|
16
20
|
"lint-staged": "lint-staged",
|
|
17
21
|
"prepare": "husky"
|
|
18
22
|
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"vue": "^3.5.38",
|
|
21
|
-
"vue-i18n": "^11.4.6",
|
|
22
|
-
"vuetify": "^4.1.2"
|
|
23
|
-
},
|
|
24
23
|
"devDependencies": {
|
|
25
24
|
"@blockly/field-colour": "^6.0.12",
|
|
26
25
|
"@blockly/plugin-cross-tab-copy-paste": "^8.0.8",
|
|
@@ -42,17 +41,33 @@
|
|
|
42
41
|
"typescript": "^6.0.3",
|
|
43
42
|
"vite": "^8.0.16",
|
|
44
43
|
"vue-draggable-plus": "^0.6.1",
|
|
44
|
+
"x-config-lib": "^0.1.0",
|
|
45
45
|
"x-config-oxfmt": "^0.1.3",
|
|
46
|
-
"x-config-oxlint": "^0.1.2"
|
|
47
|
-
"x-config-vite-lib": "^0.1.13"
|
|
46
|
+
"x-config-oxlint": "^0.1.2"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"x-
|
|
49
|
+
"vue": "^3.5.38",
|
|
50
|
+
"vue-i18n": "^11.4.6",
|
|
51
|
+
"vuetify": "^4.1.2",
|
|
52
|
+
"x-error-lib": "^0.6.0",
|
|
53
|
+
"x-essential-lib": "^0.10.0",
|
|
54
|
+
"x-runtime-lib": "^0.10.0",
|
|
55
|
+
"x-state-lib": "^0.4.0"
|
|
54
56
|
},
|
|
55
57
|
"lint-staged": {
|
|
56
58
|
"*": "oxfmt --no-error-on-unmatched-pattern"
|
|
59
|
+
},
|
|
60
|
+
"inlinedDependencies": {
|
|
61
|
+
"@blockly/field-colour": "6.0.12",
|
|
62
|
+
"@blockly/plugin-cross-tab-copy-paste": "8.0.8",
|
|
63
|
+
"@blockly/shadow-block-converter": "7.0.10",
|
|
64
|
+
"@highlightjs/vue-plugin": "2.1.0",
|
|
65
|
+
"@sindresorhus/base62": "1.0.0",
|
|
66
|
+
"@vueuse/core": "14.3.0",
|
|
67
|
+
"@vueuse/shared": "14.3.0",
|
|
68
|
+
"blockly": "12.5.1",
|
|
69
|
+
"highlight.js": "11.11.1",
|
|
70
|
+
"lodash-es": "4.18.1",
|
|
71
|
+
"vue-draggable-plus": "0.6.1"
|
|
57
72
|
}
|
|
58
73
|
}
|