@streamline-pulse/formkrafter-wc 0.3.0 → 0.4.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.
Files changed (158) hide show
  1. package/README.md +10 -8
  2. package/dist/components/fk-brick-actions.js +1 -1
  3. package/dist/components/fk-brick-list.js +1 -1
  4. package/dist/components/fk-brick-mold-item.js +1 -1
  5. package/dist/components/fk-brick-render.js +1 -1
  6. package/dist/components/fk-code-editor.js +1 -1
  7. package/dist/components/fk-data-grid.js +1 -1
  8. package/dist/components/fk-drop-area.js +1 -1
  9. package/dist/components/fk-empty-form.js +1 -1
  10. package/dist/components/fk-file-input.js +1 -1
  11. package/dist/components/fk-form-builder.js +1 -1
  12. package/dist/components/fk-form-render.js +1 -1
  13. package/dist/components/fk-property-panel.js +1 -1
  14. package/dist/components/fk-rules-editor.js +1 -1
  15. package/dist/components/fk-select-input.js +1 -1
  16. package/dist/components/fk-signature-input.js +1 -1
  17. package/dist/components/fk-stepper.js +1 -1
  18. package/dist/components/fk-tabs.js +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/components/{p-CKMHMpID.js → p-28GBFlUX.js} +4 -4
  21. package/dist/components/{p-D6n74M9d.js → p-BGxmFcpL.js} +1 -1
  22. package/dist/components/{p-DYchD23x.js → p-BInUBjyw.js} +1 -1
  23. package/dist/{formkrafter-wc/p-C-wnqV3i.js → components/p-BietHxaT.js} +1 -1
  24. package/dist/components/{p-fDJP6whN.js → p-BnzSarwW.js} +1 -1
  25. package/dist/components/p-BpkKcCCr.js +1 -0
  26. package/dist/components/p-C0Y8qh8R.js +1 -0
  27. package/dist/components/p-C5OWoRhO.js +1 -0
  28. package/dist/components/{p-wuC5rVU7.js → p-CKs1CWVz.js} +1 -1
  29. package/dist/components/{p-v7LxwCAc.js → p-CZHykCYD.js} +1 -1
  30. package/dist/components/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
  31. package/dist/components/p-CqVSd56Z.js +1 -0
  32. package/dist/components/p-CyZA17qf.js +1 -0
  33. package/dist/components/{p-BGkZP87K.js → p-D4HhZxQ-.js} +1 -1
  34. package/dist/components/p-DC6Wxbnz.js +1 -0
  35. package/dist/components/p-DRNycSdI.js +1 -0
  36. package/dist/components/{p--vL6GR31.js → p-Dh5Z49YD.js} +1 -1
  37. package/dist/components/p-DiOstAi9.js +1 -0
  38. package/dist/components/p-DlqnIm46.js +1 -0
  39. package/dist/components/{p-CIfjRTky.js → p-DshUS8Zm.js} +1 -1
  40. package/dist/components/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
  41. package/dist/components/{p-BWdm2a6q.js → p-ajy8ZcBX.js} +1 -1
  42. package/dist/components/p-kYG3E0GQ.js +1 -0
  43. package/dist/components/p-tTJg_I4V.js +1 -0
  44. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  45. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  46. package/dist/formkrafter-wc/index.esm.js +1 -1
  47. package/dist/formkrafter-wc/p-3579150a.entry.js +1 -0
  48. package/dist/formkrafter-wc/p-8b0ff66e.entry.js +1 -0
  49. package/dist/formkrafter-wc/p-BHZMDq2e.js +1 -0
  50. package/dist/{components/p-C-wnqV3i.js → formkrafter-wc/p-BietHxaT.js} +1 -1
  51. package/dist/formkrafter-wc/p-C0Y8qh8R.js +1 -0
  52. package/dist/formkrafter-wc/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
  53. package/dist/formkrafter-wc/p-DlqnIm46.js +1 -0
  54. package/dist/formkrafter-wc/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
  55. package/dist/formkrafter-wc/p-WWmY5Z05.js +1 -0
  56. package/dist/formkrafter-wc/p-hcT25XX4.js +12 -0
  57. package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +1 -0
  58. package/dist/types/components/fk-data-grid/fk-data-grid.d.ts +1 -0
  59. package/dist/types/components/fk-drop-area/fk-drop-area.d.ts +1 -0
  60. package/dist/types/components/fk-form-render/fk-form-render.d.ts +7 -1
  61. package/dist/types/components.d.ts +17 -0
  62. package/dist/types/index.d.ts +1 -1
  63. package/dist/types/registry/default-bricks.d.ts +36 -0
  64. package/dist/types/utils/mask.d.ts +1 -0
  65. package/package.json +10 -15
  66. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
  67. package/dist/cjs/fk-brick-actions_18.cjs.entry.js +0 -4224
  68. package/dist/cjs/formkrafter-wc.cjs.js +0 -25
  69. package/dist/cjs/index-Bhy1RJMV.js +0 -3042
  70. package/dist/cjs/index-CImTe9BG.js +0 -2126
  71. package/dist/cjs/index-CdaT3-qx.js +0 -5444
  72. package/dist/cjs/index-CkPPRg03.js +0 -17548
  73. package/dist/cjs/index-DHgK3reD.js +0 -12233
  74. package/dist/cjs/index-Ds0sDbXV.js +0 -4019
  75. package/dist/cjs/index-c9BL7y3N.js +0 -1922
  76. package/dist/cjs/index.cjs.js +0 -48
  77. package/dist/cjs/loader.cjs.js +0 -13
  78. package/dist/collection/collection-manifest.json +0 -30
  79. package/dist/collection/components/fk-brick-actions/fk-brick-actions.css +0 -78
  80. package/dist/collection/components/fk-brick-actions/fk-brick-actions.js +0 -215
  81. package/dist/collection/components/fk-brick-list/fk-brick-list.css +0 -71
  82. package/dist/collection/components/fk-brick-list/fk-brick-list.js +0 -55
  83. package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.css +0 -33
  84. package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.js +0 -73
  85. package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.css +0 -8
  86. package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.js +0 -18
  87. package/dist/collection/components/fk-brick-render/fk-brick-render.js +0 -447
  88. package/dist/collection/components/fk-code-editor/fk-code-editor.css +0 -26
  89. package/dist/collection/components/fk-code-editor/fk-code-editor.js +0 -145
  90. package/dist/collection/components/fk-data-grid/fk-data-grid.css +0 -75
  91. package/dist/collection/components/fk-data-grid/fk-data-grid.js +0 -300
  92. package/dist/collection/components/fk-drop-area/fk-drop-area.css +0 -18
  93. package/dist/collection/components/fk-drop-area/fk-drop-area.js +0 -98
  94. package/dist/collection/components/fk-empty-form/fk-empty-form.css +0 -22
  95. package/dist/collection/components/fk-empty-form/fk-empty-form.js +0 -19
  96. package/dist/collection/components/fk-file-input/fk-file-input.css +0 -95
  97. package/dist/collection/components/fk-file-input/fk-file-input.js +0 -239
  98. package/dist/collection/components/fk-form-builder/fk-form-builder.css +0 -112
  99. package/dist/collection/components/fk-form-builder/fk-form-builder.js +0 -431
  100. package/dist/collection/components/fk-form-render/fk-form-render.css +0 -7
  101. package/dist/collection/components/fk-form-render/fk-form-render.js +0 -352
  102. package/dist/collection/components/fk-property-panel/fk-property-panel.css +0 -153
  103. package/dist/collection/components/fk-property-panel/fk-property-panel.js +0 -388
  104. package/dist/collection/components/fk-rules-editor/fk-rules-editor.css +0 -166
  105. package/dist/collection/components/fk-rules-editor/fk-rules-editor.js +0 -250
  106. package/dist/collection/components/fk-select-input/fk-select-input.css +0 -153
  107. package/dist/collection/components/fk-select-input/fk-select-input.js +0 -454
  108. package/dist/collection/components/fk-signature-input/fk-signature-input.css +0 -42
  109. package/dist/collection/components/fk-signature-input/fk-signature-input.js +0 -158
  110. package/dist/collection/components/fk-stepper/fk-stepper.css +0 -99
  111. package/dist/collection/components/fk-stepper/fk-stepper.js +0 -285
  112. package/dist/collection/components/fk-tabs/fk-tabs.css +0 -38
  113. package/dist/collection/components/fk-tabs/fk-tabs.js +0 -249
  114. package/dist/collection/i18n/i18n.js +0 -265
  115. package/dist/collection/index.js +0 -5
  116. package/dist/collection/registry/create-brick.js +0 -34
  117. package/dist/collection/registry/default-bricks.js +0 -564
  118. package/dist/collection/registry/registry.js +0 -44
  119. package/dist/collection/utils/brick-data.js +0 -16
  120. package/dist/collection/utils/drop.js +0 -14
  121. package/dist/collection/utils/events.js +0 -1
  122. package/dist/collection/utils/options.js +0 -21
  123. package/dist/collection/utils/remote.js +0 -27
  124. package/dist/collection/utils/rule-condition.js +0 -72
  125. package/dist/collection/utils/style.js +0 -11
  126. package/dist/components/p-BOmBVgfJ.js +0 -1
  127. package/dist/components/p-B_-x-GlA.js +0 -1
  128. package/dist/components/p-Br1s4Ujx.js +0 -1
  129. package/dist/components/p-CUF31e-P.js +0 -1
  130. package/dist/components/p-CWQX0sXS.js +0 -1
  131. package/dist/components/p-DFe3zZCI.js +0 -1
  132. package/dist/components/p-DOInQkG6.js +0 -1
  133. package/dist/components/p-PAr7WoWG.js +0 -1
  134. package/dist/components/p-YyGnQmX-.js +0 -1
  135. package/dist/components/p-swxZqinH.js +0 -1
  136. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  137. package/dist/esm/fk-brick-actions_18.entry.js +0 -4205
  138. package/dist/esm/formkrafter-wc.js +0 -21
  139. package/dist/esm/index-BAcz7b5u.js +0 -5416
  140. package/dist/esm/index-BkRMoLXK.js +0 -3029
  141. package/dist/esm/index-CGMDfZ5m.js +0 -1808
  142. package/dist/esm/index-D7Cta1UB.js +0 -17488
  143. package/dist/esm/index-DtcM1yw5.js +0 -3991
  144. package/dist/esm/index-DuVf3NlP.js +0 -12222
  145. package/dist/esm/index-qLZlXROB.js +0 -2117
  146. package/dist/esm/index.js +0 -2
  147. package/dist/esm/loader.js +0 -11
  148. package/dist/formkrafter-wc/p-6d29555b.entry.js +0 -1
  149. package/dist/formkrafter-wc/p-DOInQkG6.js +0 -1
  150. package/dist/formkrafter-wc/p-Ddu6BquK.js +0 -12
  151. package/dist/index.cjs.js +0 -1
  152. package/dist/index.js +0 -1
  153. package/dist/stencil.config.js +0 -34
  154. package/loader/cdn.js +0 -1
  155. package/loader/index.cjs.js +0 -1
  156. package/loader/index.d.ts +0 -24
  157. package/loader/index.es2017.js +0 -1
  158. package/loader/index.js +0 -2
@@ -1,447 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { getAffectedProperties, resolveLocalizedRecord, } from "@streamline-pulse/formkrafter-core";
3
- import { getBrick } from "../../registry/registry";
4
- import { getBrickData, wrapBrickData } from "../../utils/brick-data";
5
- export class FkBrickRender {
6
- constructor() {
7
- this.path = '0';
8
- this.editable = false;
9
- this.errors = {};
10
- }
11
- render() {
12
- var _a, _b, _c, _d, _e, _f;
13
- const spec = this.brickSpec;
14
- if (!spec)
15
- return null;
16
- const brick = getBrick(spec.type, spec.id);
17
- if (!brick) {
18
- return h("fk-brick-not-found", null, `${spec.type}:${spec.id}`);
19
- }
20
- const editing = this.editable && ((_a = spec.editable) !== null && _a !== void 0 ? _a : true);
21
- const affected = getAffectedProperties(spec.rules, this.dataMap);
22
- if (!editing && affected.hidden === true)
23
- return null;
24
- const isContainer = spec.type === 'panel' || spec.type === 'collection';
25
- const uid = (_b = spec.configs) === null || _b === void 0 ? void 0 : _b.uid;
26
- const childNodes = ((_c = spec.children) !== null && _c !== void 0 ? _c : []).map((childSpec, index) => {
27
- var _a;
28
- return (h("fk-brick-render", { brickSpec: childSpec, rootSpec: (_a = this.rootSpec) !== null && _a !== void 0 ? _a : this.brickSpec, data: this.data, dataMap: this.dataMap, errors: this.errors, locale: this.locale, path: `${this.path}.${index}`, editable: this.editable, selectedUid: this.selectedUid, utils: this.utils }));
29
- });
30
- if (editing && isContainer) {
31
- childNodes.push(h("fk-drop-area", { path: this.path }));
32
- }
33
- const props = {
34
- brickSpec: spec,
35
- configsForm: spec.configsForm,
36
- configs: resolveLocalizedRecord(spec.configs, this.locale),
37
- locale: this.locale,
38
- styles: (_d = spec.styles) !== null && _d !== void 0 ? _d : {},
39
- data: getBrickData(spec, this.data),
40
- dataMap: this.dataMap,
41
- rootSpec: (_e = this.rootSpec) !== null && _e !== void 0 ? _e : this.brickSpec,
42
- error: ((_f = spec.configs) === null || _f === void 0 ? void 0 : _f.key) ? this.errors[spec.configs.key] : undefined,
43
- disabled: editing ? false : affected.disabled === true,
44
- path: this.path,
45
- editable: editing,
46
- children: childNodes,
47
- validations: spec.validations,
48
- rules: spec.rules,
49
- utils: this.utils,
50
- onDataChange: (value) => {
51
- const wrapped = wrapBrickData(spec, value);
52
- if (wrapped !== undefined)
53
- this.brickDataChange.emit(wrapped);
54
- },
55
- onConfigsChange: (configs, changedUid) => this.brickConfigsChange.emit({ configs, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
56
- onStylesChange: (styles, changedUid) => this.brickStylesChange.emit({
57
- styles: styles,
58
- uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid,
59
- }),
60
- onValidationsChange: (validations, changedUid) => this.brickValidationsChange.emit({ validations, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
61
- onRulesChange: (rules, changedUid) => this.brickRulesChange.emit({ rules, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
62
- onDelete: (path) => this.brickRemove.emit({ path }),
63
- onDuplicate: (path) => this.brickDuplicate.emit({ path }),
64
- };
65
- const node = (editing ? brick.renderBuilder(props) : brick.render(props));
66
- if (!editing || this.path === '0')
67
- return node;
68
- return (h("fk-brick-actions", { path: this.path, selected: uid !== undefined && uid === this.selectedUid }, node));
69
- }
70
- static get is() { return "fk-brick-render"; }
71
- static get properties() {
72
- return {
73
- "brickSpec": {
74
- "type": "unknown",
75
- "mutable": false,
76
- "complexType": {
77
- "original": "BrickSpec",
78
- "resolved": "BrickSpec",
79
- "references": {
80
- "BrickSpec": {
81
- "location": "import",
82
- "path": "@streamline-pulse/formkrafter-core",
83
- "id": "../core/dist/index.d.ts::BrickSpec",
84
- "referenceLocation": "BrickSpec"
85
- }
86
- }
87
- },
88
- "required": true,
89
- "optional": false,
90
- "docs": {
91
- "tags": [],
92
- "text": ""
93
- },
94
- "getter": false,
95
- "setter": false
96
- },
97
- "rootSpec": {
98
- "type": "unknown",
99
- "mutable": false,
100
- "complexType": {
101
- "original": "BrickSpec",
102
- "resolved": "BrickSpec",
103
- "references": {
104
- "BrickSpec": {
105
- "location": "import",
106
- "path": "@streamline-pulse/formkrafter-core",
107
- "id": "../core/dist/index.d.ts::BrickSpec",
108
- "referenceLocation": "BrickSpec"
109
- }
110
- }
111
- },
112
- "required": false,
113
- "optional": true,
114
- "docs": {
115
- "tags": [],
116
- "text": ""
117
- },
118
- "getter": false,
119
- "setter": false
120
- },
121
- "data": {
122
- "type": "unknown",
123
- "mutable": false,
124
- "complexType": {
125
- "original": "Record<string, unknown>",
126
- "resolved": "string | unknown",
127
- "references": {
128
- "Record": {
129
- "location": "global",
130
- "id": "global::Record"
131
- }
132
- }
133
- },
134
- "required": false,
135
- "optional": true,
136
- "docs": {
137
- "tags": [],
138
- "text": ""
139
- },
140
- "getter": false,
141
- "setter": false
142
- },
143
- "dataMap": {
144
- "type": "unknown",
145
- "mutable": false,
146
- "complexType": {
147
- "original": "Record<string, unknown>",
148
- "resolved": "string | unknown",
149
- "references": {
150
- "Record": {
151
- "location": "global",
152
- "id": "global::Record"
153
- }
154
- }
155
- },
156
- "required": false,
157
- "optional": true,
158
- "docs": {
159
- "tags": [],
160
- "text": ""
161
- },
162
- "getter": false,
163
- "setter": false
164
- },
165
- "path": {
166
- "type": "string",
167
- "mutable": false,
168
- "complexType": {
169
- "original": "string",
170
- "resolved": "string",
171
- "references": {}
172
- },
173
- "required": false,
174
- "optional": false,
175
- "docs": {
176
- "tags": [],
177
- "text": ""
178
- },
179
- "getter": false,
180
- "setter": false,
181
- "reflect": false,
182
- "attribute": "path",
183
- "defaultValue": "'0'"
184
- },
185
- "editable": {
186
- "type": "boolean",
187
- "mutable": false,
188
- "complexType": {
189
- "original": "boolean",
190
- "resolved": "boolean",
191
- "references": {}
192
- },
193
- "required": false,
194
- "optional": false,
195
- "docs": {
196
- "tags": [],
197
- "text": ""
198
- },
199
- "getter": false,
200
- "setter": false,
201
- "reflect": false,
202
- "attribute": "editable",
203
- "defaultValue": "false"
204
- },
205
- "selectedUid": {
206
- "type": "string",
207
- "mutable": false,
208
- "complexType": {
209
- "original": "string",
210
- "resolved": "string",
211
- "references": {}
212
- },
213
- "required": false,
214
- "optional": true,
215
- "docs": {
216
- "tags": [],
217
- "text": ""
218
- },
219
- "getter": false,
220
- "setter": false,
221
- "reflect": false,
222
- "attribute": "selected-uid"
223
- },
224
- "errors": {
225
- "type": "unknown",
226
- "mutable": false,
227
- "complexType": {
228
- "original": "Record<string, string>",
229
- "resolved": "string",
230
- "references": {
231
- "Record": {
232
- "location": "global",
233
- "id": "global::Record"
234
- }
235
- }
236
- },
237
- "required": false,
238
- "optional": false,
239
- "docs": {
240
- "tags": [],
241
- "text": ""
242
- },
243
- "getter": false,
244
- "setter": false,
245
- "defaultValue": "{}"
246
- },
247
- "locale": {
248
- "type": "string",
249
- "mutable": false,
250
- "complexType": {
251
- "original": "string",
252
- "resolved": "string",
253
- "references": {}
254
- },
255
- "required": false,
256
- "optional": true,
257
- "docs": {
258
- "tags": [],
259
- "text": ""
260
- },
261
- "getter": false,
262
- "setter": false,
263
- "reflect": false,
264
- "attribute": "locale"
265
- },
266
- "utils": {
267
- "type": "unknown",
268
- "mutable": false,
269
- "complexType": {
270
- "original": "Utils",
271
- "resolved": "object & { validateForm: () => { isValid: boolean; }; }",
272
- "references": {
273
- "Utils": {
274
- "location": "import",
275
- "path": "@streamline-pulse/formkrafter-core",
276
- "id": "../core/dist/index.d.ts::Utils",
277
- "referenceLocation": "Utils"
278
- }
279
- }
280
- },
281
- "required": true,
282
- "optional": false,
283
- "docs": {
284
- "tags": [],
285
- "text": ""
286
- },
287
- "getter": false,
288
- "setter": false
289
- }
290
- };
291
- }
292
- static get events() {
293
- return [{
294
- "method": "brickDataChange",
295
- "name": "brickDataChange",
296
- "bubbles": true,
297
- "cancelable": true,
298
- "composed": true,
299
- "docs": {
300
- "tags": [],
301
- "text": ""
302
- },
303
- "complexType": {
304
- "original": "Record<string, unknown>",
305
- "resolved": "string | unknown",
306
- "references": {
307
- "Record": {
308
- "location": "global",
309
- "id": "global::Record"
310
- }
311
- }
312
- }
313
- }, {
314
- "method": "brickConfigsChange",
315
- "name": "brickConfigsChange",
316
- "bubbles": true,
317
- "cancelable": true,
318
- "composed": true,
319
- "docs": {
320
- "tags": [],
321
- "text": ""
322
- },
323
- "complexType": {
324
- "original": "BrickConfigsChangeDetail",
325
- "resolved": "BrickConfigsChangeDetail",
326
- "references": {
327
- "BrickConfigsChangeDetail": {
328
- "location": "import",
329
- "path": "../../utils/events",
330
- "id": "src/utils/events.ts::BrickConfigsChangeDetail",
331
- "referenceLocation": "BrickConfigsChangeDetail"
332
- }
333
- }
334
- }
335
- }, {
336
- "method": "brickStylesChange",
337
- "name": "brickStylesChange",
338
- "bubbles": true,
339
- "cancelable": true,
340
- "composed": true,
341
- "docs": {
342
- "tags": [],
343
- "text": ""
344
- },
345
- "complexType": {
346
- "original": "BrickStylesChangeDetail",
347
- "resolved": "BrickStylesChangeDetail",
348
- "references": {
349
- "BrickStylesChangeDetail": {
350
- "location": "import",
351
- "path": "../../utils/events",
352
- "id": "src/utils/events.ts::BrickStylesChangeDetail",
353
- "referenceLocation": "BrickStylesChangeDetail"
354
- }
355
- }
356
- }
357
- }, {
358
- "method": "brickValidationsChange",
359
- "name": "brickValidationsChange",
360
- "bubbles": true,
361
- "cancelable": true,
362
- "composed": true,
363
- "docs": {
364
- "tags": [],
365
- "text": ""
366
- },
367
- "complexType": {
368
- "original": "BrickValidationsChangeDetail",
369
- "resolved": "BrickValidationsChangeDetail",
370
- "references": {
371
- "BrickValidationsChangeDetail": {
372
- "location": "import",
373
- "path": "../../utils/events",
374
- "id": "src/utils/events.ts::BrickValidationsChangeDetail",
375
- "referenceLocation": "BrickValidationsChangeDetail"
376
- }
377
- }
378
- }
379
- }, {
380
- "method": "brickRulesChange",
381
- "name": "brickRulesChange",
382
- "bubbles": true,
383
- "cancelable": true,
384
- "composed": true,
385
- "docs": {
386
- "tags": [],
387
- "text": ""
388
- },
389
- "complexType": {
390
- "original": "BrickRulesChangeDetail",
391
- "resolved": "BrickRulesChangeDetail",
392
- "references": {
393
- "BrickRulesChangeDetail": {
394
- "location": "import",
395
- "path": "../../utils/events",
396
- "id": "src/utils/events.ts::BrickRulesChangeDetail",
397
- "referenceLocation": "BrickRulesChangeDetail"
398
- }
399
- }
400
- }
401
- }, {
402
- "method": "brickRemove",
403
- "name": "brickRemove",
404
- "bubbles": true,
405
- "cancelable": true,
406
- "composed": true,
407
- "docs": {
408
- "tags": [],
409
- "text": ""
410
- },
411
- "complexType": {
412
- "original": "BrickPathDetail",
413
- "resolved": "BrickPathDetail",
414
- "references": {
415
- "BrickPathDetail": {
416
- "location": "import",
417
- "path": "../../utils/events",
418
- "id": "src/utils/events.ts::BrickPathDetail",
419
- "referenceLocation": "BrickPathDetail"
420
- }
421
- }
422
- }
423
- }, {
424
- "method": "brickDuplicate",
425
- "name": "brickDuplicate",
426
- "bubbles": true,
427
- "cancelable": true,
428
- "composed": true,
429
- "docs": {
430
- "tags": [],
431
- "text": ""
432
- },
433
- "complexType": {
434
- "original": "BrickPathDetail",
435
- "resolved": "BrickPathDetail",
436
- "references": {
437
- "BrickPathDetail": {
438
- "location": "import",
439
- "path": "../../utils/events",
440
- "id": "src/utils/events.ts::BrickPathDetail",
441
- "referenceLocation": "BrickPathDetail"
442
- }
443
- }
444
- }
445
- }];
446
- }
447
- }
@@ -1,26 +0,0 @@
1
- :host {
2
- display: block;
3
- }
4
-
5
- :host .cm-editor {
6
- min-height: 88px;
7
- font-size: 0.75rem;
8
- border: 1px solid var(--fk-color-border);
9
- border-radius: calc(var(--fk-radius) / 2);
10
- background: var(--fk-color-surface);
11
- }
12
-
13
- :host .cm-editor.cm-focused {
14
- outline: none;
15
- border-color: var(--fk-color-primary);
16
- }
17
-
18
- :host .cm-gutters {
19
- border-right: 1px solid var(--fk-color-border);
20
- background: color-mix(in srgb, var(--fk-color-surface) 70%, transparent);
21
- color: var(--fk-color-muted);
22
- }
23
-
24
- :host .cm-content {
25
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
26
- }
@@ -1,145 +0,0 @@
1
- const fetchCodeMirror = () => Promise.all([
2
- import('@codemirror/state'),
3
- import('@codemirror/view'),
4
- import('@codemirror/commands'),
5
- import('@codemirror/language'),
6
- import('@codemirror/lang-javascript'),
7
- ]);
8
- let codeMirrorModules;
9
- const loadCodeMirror = () => (codeMirrorModules !== null && codeMirrorModules !== void 0 ? codeMirrorModules : (codeMirrorModules = fetchCodeMirror()));
10
- export class FkCodeEditor {
11
- constructor() {
12
- this.value = '';
13
- this.placeholder = '';
14
- this.disconnected = false;
15
- }
16
- async componentDidLoad() {
17
- const [{ EditorState }, { EditorView: View, keymap, lineNumbers, placeholder: cmPlaceholder }, { defaultKeymap, history, historyKeymap }, { defaultHighlightStyle, syntaxHighlighting }, { javascript },] = await loadCodeMirror();
18
- if (this.disconnected)
19
- return;
20
- this.view = new View({
21
- parent: this.host,
22
- state: EditorState.create({
23
- doc: this.value,
24
- extensions: [
25
- lineNumbers(),
26
- history(),
27
- keymap.of([...defaultKeymap, ...historyKeymap]),
28
- javascript(),
29
- syntaxHighlighting(defaultHighlightStyle),
30
- cmPlaceholder(this.placeholder),
31
- View.domEventHandlers({
32
- blur: () => this.emitIfChanged(),
33
- }),
34
- ],
35
- }),
36
- });
37
- }
38
- syncValue(next) {
39
- if (!this.view || this.view.hasFocus)
40
- return;
41
- const current = this.view.state.doc.toString();
42
- if (current !== next) {
43
- this.view.dispatch({
44
- changes: { from: 0, to: current.length, insert: next },
45
- });
46
- }
47
- }
48
- emitIfChanged() {
49
- if (!this.view)
50
- return;
51
- const doc = this.view.state.doc.toString();
52
- if (doc !== this.value)
53
- this.codeChange.emit(doc);
54
- }
55
- disconnectedCallback() {
56
- var _a;
57
- this.disconnected = true;
58
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.destroy();
59
- this.view = undefined;
60
- }
61
- render() {
62
- return null;
63
- }
64
- static get is() { return "fk-code-editor"; }
65
- static get encapsulation() { return "scoped"; }
66
- static get originalStyleUrls() {
67
- return {
68
- "$": ["fk-code-editor.css"]
69
- };
70
- }
71
- static get styleUrls() {
72
- return {
73
- "$": ["fk-code-editor.css"]
74
- };
75
- }
76
- static get properties() {
77
- return {
78
- "value": {
79
- "type": "string",
80
- "mutable": false,
81
- "complexType": {
82
- "original": "string",
83
- "resolved": "string",
84
- "references": {}
85
- },
86
- "required": false,
87
- "optional": false,
88
- "docs": {
89
- "tags": [],
90
- "text": ""
91
- },
92
- "getter": false,
93
- "setter": false,
94
- "reflect": false,
95
- "attribute": "value",
96
- "defaultValue": "''"
97
- },
98
- "placeholder": {
99
- "type": "string",
100
- "mutable": false,
101
- "complexType": {
102
- "original": "string",
103
- "resolved": "string",
104
- "references": {}
105
- },
106
- "required": false,
107
- "optional": false,
108
- "docs": {
109
- "tags": [],
110
- "text": ""
111
- },
112
- "getter": false,
113
- "setter": false,
114
- "reflect": false,
115
- "attribute": "placeholder",
116
- "defaultValue": "''"
117
- }
118
- };
119
- }
120
- static get events() {
121
- return [{
122
- "method": "codeChange",
123
- "name": "codeChange",
124
- "bubbles": true,
125
- "cancelable": true,
126
- "composed": true,
127
- "docs": {
128
- "tags": [],
129
- "text": ""
130
- },
131
- "complexType": {
132
- "original": "string",
133
- "resolved": "string",
134
- "references": {}
135
- }
136
- }];
137
- }
138
- static get elementRef() { return "host"; }
139
- static get watchers() {
140
- return [{
141
- "propName": "value",
142
- "methodName": "syncValue"
143
- }];
144
- }
145
- }
@@ -1,75 +0,0 @@
1
- :host {
2
- display: block;
3
- }
4
-
5
- .fk-grid {
6
- display: flex;
7
- flex-direction: column;
8
- gap: var(--fk-spacing);
9
- }
10
-
11
- .fk-grid__empty {
12
- margin: 0;
13
- padding: var(--fk-spacing);
14
- border: 1px dashed var(--fk-color-border);
15
- border-radius: var(--fk-radius);
16
- font-size: 0.85rem;
17
- color: var(--fk-color-muted);
18
- text-align: center;
19
- }
20
-
21
- .fk-grid__row {
22
- display: flex;
23
- align-items: flex-start;
24
- gap: var(--fk-spacing);
25
- padding: var(--fk-spacing);
26
- border: 1px solid var(--fk-color-border);
27
- border-radius: var(--fk-radius);
28
- background: color-mix(in srgb, var(--fk-color-surface) 60%, transparent);
29
- }
30
-
31
- .fk-grid__cells {
32
- display: flex;
33
- flex: 1;
34
- flex-wrap: wrap;
35
- gap: var(--fk-spacing);
36
- min-width: 0;
37
- }
38
-
39
- .fk-grid__cells > * {
40
- flex: 1;
41
- min-width: 160px;
42
- }
43
-
44
- .fk-grid__remove {
45
- border: none;
46
- background: transparent;
47
- color: var(--fk-color-muted);
48
- font-size: 0.8rem;
49
- cursor: pointer;
50
- padding: 4px 6px;
51
- border-radius: calc(var(--fk-radius) / 2);
52
- }
53
-
54
- .fk-grid__remove:hover:not(:disabled) {
55
- color: var(--fk-color-danger);
56
- background: color-mix(in srgb, var(--fk-color-danger) 10%, transparent);
57
- }
58
-
59
- .fk-grid__add {
60
- align-self: flex-start;
61
- font: inherit;
62
- font-size: 0.8rem;
63
- font-weight: 600;
64
- padding: calc(var(--fk-spacing) / 1.5) var(--fk-spacing);
65
- border: 1px dashed var(--fk-color-border);
66
- border-radius: var(--fk-radius);
67
- background: transparent;
68
- color: var(--fk-color-muted);
69
- cursor: pointer;
70
- }
71
-
72
- .fk-grid__add:hover:not(:disabled) {
73
- border-color: var(--fk-color-primary);
74
- color: var(--fk-color-primary);
75
- }