@kubohiroya/turbowarp-extension-data-editor 0.2.1 → 0.3.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/README.md +4 -2
- package/dist/build-info.json +4 -4
- package/dist/config/feature-flags.d.ts +5 -0
- package/dist/config/feature-flags.js +6 -0
- package/dist/form-presentation.d.ts +8 -0
- package/dist/form-presentation.js +61 -0
- package/dist/layout-view.d.ts +21 -0
- package/dist/layout-view.js +127 -0
- package/dist/layout.d.ts +31 -0
- package/dist/layout.js +63 -0
- package/dist/react.css +126 -0
- package/dist/react.d.ts +5 -0
- package/dist/react.js +10 -2
- package/dist/rjsf-templates.d.ts +18 -0
- package/dist/rjsf-templates.js +199 -0
- package/dist/rjsf.d.ts +11 -8
- package/dist/rjsf.js +35 -12
- package/dist/schema-presentation.d.ts +10 -0
- package/dist/schema-presentation.js +109 -0
- package/dist/source-editor.d.ts +2 -1
- package/dist/source-editor.js +23 -5
- package/dist/source-view.d.ts +1 -1
- package/dist/source-view.js +222 -122
- package/dist/turbowarp/appearance.d.ts +1 -1
- package/dist/turbowarp/appearance.js +23 -5
- package/dist/turbowarp/bridge.js +5 -1
- package/dist/turbowarp.d.ts +2 -1
- package/dist/turbowarp.js +3 -2
- package/dist/webpack4/metafile.json +162 -21
- package/dist/webpack4/react.js +12 -6
- package/dist/webpack4/react.js.map +2 -2
- package/dist/webpack4/rjsf.js +1117 -261
- package/dist/webpack4/rjsf.js.map +4 -4
- package/dist/webpack4/turbowarp.js +22 -5
- package/dist/webpack4/turbowarp.js.map +2 -2
- package/docs/README.md +1 -0
- package/docs/api.md +7 -0
- package/docs/common-layout.ja.md +117 -0
- package/docs/package-distribution.md +5 -0
- package/package.json +1 -7
|
@@ -2082,6 +2082,48 @@
|
|
|
2082
2082
|
],
|
|
2083
2083
|
"format": "esm"
|
|
2084
2084
|
},
|
|
2085
|
+
"dist/config/feature-flags.js": {
|
|
2086
|
+
"bytes": 294,
|
|
2087
|
+
"imports": [],
|
|
2088
|
+
"format": "esm"
|
|
2089
|
+
},
|
|
2090
|
+
"dist/form-presentation.js": {
|
|
2091
|
+
"bytes": 7310,
|
|
2092
|
+
"imports": [
|
|
2093
|
+
{
|
|
2094
|
+
"path": "react",
|
|
2095
|
+
"kind": "import-statement",
|
|
2096
|
+
"external": true
|
|
2097
|
+
}
|
|
2098
|
+
],
|
|
2099
|
+
"format": "esm"
|
|
2100
|
+
},
|
|
2101
|
+
"dist/layout.js": {
|
|
2102
|
+
"bytes": 3259,
|
|
2103
|
+
"imports": [],
|
|
2104
|
+
"format": "esm"
|
|
2105
|
+
},
|
|
2106
|
+
"dist/layout-view.js": {
|
|
2107
|
+
"bytes": 8271,
|
|
2108
|
+
"imports": [
|
|
2109
|
+
{
|
|
2110
|
+
"path": "react",
|
|
2111
|
+
"kind": "import-statement",
|
|
2112
|
+
"external": true
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
"path": "dist/form-presentation.js",
|
|
2116
|
+
"kind": "import-statement",
|
|
2117
|
+
"original": "./form-presentation.js"
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
"path": "dist/layout.js",
|
|
2121
|
+
"kind": "import-statement",
|
|
2122
|
+
"original": "./layout.js"
|
|
2123
|
+
}
|
|
2124
|
+
],
|
|
2125
|
+
"format": "esm"
|
|
2126
|
+
},
|
|
2085
2127
|
"node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js": {
|
|
2086
2128
|
"bytes": 1513,
|
|
2087
2129
|
"imports": [],
|
|
@@ -3719,8 +3761,13 @@
|
|
|
3719
3761
|
],
|
|
3720
3762
|
"format": "esm"
|
|
3721
3763
|
},
|
|
3764
|
+
"dist/schema-presentation.js": {
|
|
3765
|
+
"bytes": 5336,
|
|
3766
|
+
"imports": [],
|
|
3767
|
+
"format": "esm"
|
|
3768
|
+
},
|
|
3722
3769
|
"dist/source-view.js": {
|
|
3723
|
-
"bytes":
|
|
3770
|
+
"bytes": 30052,
|
|
3724
3771
|
"imports": [
|
|
3725
3772
|
{
|
|
3726
3773
|
"path": "react",
|
|
@@ -3732,6 +3779,11 @@
|
|
|
3732
3779
|
"kind": "import-statement",
|
|
3733
3780
|
"external": true
|
|
3734
3781
|
},
|
|
3782
|
+
{
|
|
3783
|
+
"path": "dist/layout-view.js",
|
|
3784
|
+
"kind": "import-statement",
|
|
3785
|
+
"original": "./layout-view.js"
|
|
3786
|
+
},
|
|
3735
3787
|
{
|
|
3736
3788
|
"path": "dist/source-editor.js",
|
|
3737
3789
|
"kind": "import-statement",
|
|
@@ -3741,13 +3793,28 @@
|
|
|
3741
3793
|
"path": "dist/data.js",
|
|
3742
3794
|
"kind": "import-statement",
|
|
3743
3795
|
"original": "./data.js"
|
|
3796
|
+
},
|
|
3797
|
+
{
|
|
3798
|
+
"path": "dist/form-presentation.js",
|
|
3799
|
+
"kind": "import-statement",
|
|
3800
|
+
"original": "./form-presentation.js"
|
|
3801
|
+
},
|
|
3802
|
+
{
|
|
3803
|
+
"path": "dist/schema-presentation.js",
|
|
3804
|
+
"kind": "import-statement",
|
|
3805
|
+
"original": "./schema-presentation.js"
|
|
3744
3806
|
}
|
|
3745
3807
|
],
|
|
3746
3808
|
"format": "esm"
|
|
3747
3809
|
},
|
|
3748
3810
|
"dist/source-editor.js": {
|
|
3749
|
-
"bytes":
|
|
3811
|
+
"bytes": 15186,
|
|
3750
3812
|
"imports": [
|
|
3813
|
+
{
|
|
3814
|
+
"path": "dist/config/feature-flags.js",
|
|
3815
|
+
"kind": "import-statement",
|
|
3816
|
+
"original": "./config/feature-flags.js"
|
|
3817
|
+
},
|
|
3751
3818
|
{
|
|
3752
3819
|
"path": "dist/schema-engine.js",
|
|
3753
3820
|
"kind": "import-statement",
|
|
@@ -13961,14 +14028,50 @@
|
|
|
13961
14028
|
],
|
|
13962
14029
|
"format": "esm"
|
|
13963
14030
|
},
|
|
14031
|
+
"dist/rjsf-templates.js": {
|
|
14032
|
+
"bytes": 12307,
|
|
14033
|
+
"imports": [
|
|
14034
|
+
{
|
|
14035
|
+
"path": "react",
|
|
14036
|
+
"kind": "import-statement",
|
|
14037
|
+
"external": true
|
|
14038
|
+
},
|
|
14039
|
+
{
|
|
14040
|
+
"path": "dist/layout-view.js",
|
|
14041
|
+
"kind": "import-statement",
|
|
14042
|
+
"original": "./layout-view.js"
|
|
14043
|
+
},
|
|
14044
|
+
{
|
|
14045
|
+
"path": "dist/layout.js",
|
|
14046
|
+
"kind": "import-statement",
|
|
14047
|
+
"original": "./layout.js"
|
|
14048
|
+
},
|
|
14049
|
+
{
|
|
14050
|
+
"path": "dist/form-presentation.js",
|
|
14051
|
+
"kind": "import-statement",
|
|
14052
|
+
"original": "./form-presentation.js"
|
|
14053
|
+
}
|
|
14054
|
+
],
|
|
14055
|
+
"format": "esm"
|
|
14056
|
+
},
|
|
13964
14057
|
"dist/rjsf.js": {
|
|
13965
|
-
"bytes":
|
|
14058
|
+
"bytes": 15030,
|
|
13966
14059
|
"imports": [
|
|
13967
14060
|
{
|
|
13968
14061
|
"path": "react",
|
|
13969
14062
|
"kind": "import-statement",
|
|
13970
14063
|
"external": true
|
|
13971
14064
|
},
|
|
14065
|
+
{
|
|
14066
|
+
"path": "dist/config/feature-flags.js",
|
|
14067
|
+
"kind": "import-statement",
|
|
14068
|
+
"original": "./config/feature-flags.js"
|
|
14069
|
+
},
|
|
14070
|
+
{
|
|
14071
|
+
"path": "dist/layout-view.js",
|
|
14072
|
+
"kind": "import-statement",
|
|
14073
|
+
"original": "./layout-view.js"
|
|
14074
|
+
},
|
|
13972
14075
|
{
|
|
13973
14076
|
"path": "dist/source-editor.js",
|
|
13974
14077
|
"kind": "import-statement",
|
|
@@ -14053,6 +14156,11 @@
|
|
|
14053
14156
|
"path": "dist/types.js",
|
|
14054
14157
|
"kind": "import-statement",
|
|
14055
14158
|
"original": "./types.js"
|
|
14159
|
+
},
|
|
14160
|
+
{
|
|
14161
|
+
"path": "dist/rjsf-templates.js",
|
|
14162
|
+
"kind": "import-statement",
|
|
14163
|
+
"original": "./rjsf-templates.js"
|
|
14056
14164
|
}
|
|
14057
14165
|
],
|
|
14058
14166
|
"format": "esm"
|
|
@@ -14063,7 +14171,7 @@
|
|
|
14063
14171
|
"format": "esm"
|
|
14064
14172
|
},
|
|
14065
14173
|
"dist/react.js": {
|
|
14066
|
-
"bytes":
|
|
14174
|
+
"bytes": 14377,
|
|
14067
14175
|
"imports": [
|
|
14068
14176
|
{
|
|
14069
14177
|
"path": "dist/field-errors.js",
|
|
@@ -14167,7 +14275,7 @@
|
|
|
14167
14275
|
"format": "esm"
|
|
14168
14276
|
},
|
|
14169
14277
|
"dist/turbowarp/appearance.js": {
|
|
14170
|
-
"bytes":
|
|
14278
|
+
"bytes": 2791,
|
|
14171
14279
|
"imports": [],
|
|
14172
14280
|
"format": "esm"
|
|
14173
14281
|
},
|
|
@@ -14177,7 +14285,7 @@
|
|
|
14177
14285
|
"format": "esm"
|
|
14178
14286
|
},
|
|
14179
14287
|
"dist/turbowarp/bridge.js": {
|
|
14180
|
-
"bytes":
|
|
14288
|
+
"bytes": 9167,
|
|
14181
14289
|
"imports": [
|
|
14182
14290
|
{
|
|
14183
14291
|
"path": "dist/turbowarp/host.js",
|
|
@@ -14208,7 +14316,7 @@
|
|
|
14208
14316
|
"format": "esm"
|
|
14209
14317
|
},
|
|
14210
14318
|
"dist/turbowarp.js": {
|
|
14211
|
-
"bytes":
|
|
14319
|
+
"bytes": 1788,
|
|
14212
14320
|
"imports": [
|
|
14213
14321
|
{
|
|
14214
14322
|
"path": "dist/turbowarp/bridge.js",
|
|
@@ -14297,7 +14405,7 @@
|
|
|
14297
14405
|
"imports": [],
|
|
14298
14406
|
"exports": [],
|
|
14299
14407
|
"inputs": {},
|
|
14300
|
-
"bytes":
|
|
14408
|
+
"bytes": 1928529
|
|
14301
14409
|
},
|
|
14302
14410
|
"dist/webpack4/rjsf.js": {
|
|
14303
14411
|
"imports": [
|
|
@@ -14331,6 +14439,16 @@
|
|
|
14331
14439
|
"kind": "import-statement",
|
|
14332
14440
|
"external": true
|
|
14333
14441
|
},
|
|
14442
|
+
{
|
|
14443
|
+
"path": "react",
|
|
14444
|
+
"kind": "import-statement",
|
|
14445
|
+
"external": true
|
|
14446
|
+
},
|
|
14447
|
+
{
|
|
14448
|
+
"path": "react",
|
|
14449
|
+
"kind": "import-statement",
|
|
14450
|
+
"external": true
|
|
14451
|
+
},
|
|
14334
14452
|
{
|
|
14335
14453
|
"path": "react-dom",
|
|
14336
14454
|
"kind": "import-statement",
|
|
@@ -14681,6 +14799,11 @@
|
|
|
14681
14799
|
"kind": "import-statement",
|
|
14682
14800
|
"external": true
|
|
14683
14801
|
},
|
|
14802
|
+
{
|
|
14803
|
+
"path": "react",
|
|
14804
|
+
"kind": "import-statement",
|
|
14805
|
+
"external": true
|
|
14806
|
+
},
|
|
14684
14807
|
{
|
|
14685
14808
|
"path": "react",
|
|
14686
14809
|
"kind": "import-statement",
|
|
@@ -15360,7 +15483,19 @@
|
|
|
15360
15483
|
"bytesInOutput": 275
|
|
15361
15484
|
},
|
|
15362
15485
|
"dist/rjsf.js": {
|
|
15363
|
-
"bytesInOutput":
|
|
15486
|
+
"bytesInOutput": 11742
|
|
15487
|
+
},
|
|
15488
|
+
"dist/config/feature-flags.js": {
|
|
15489
|
+
"bytesInOutput": 274
|
|
15490
|
+
},
|
|
15491
|
+
"dist/layout-view.js": {
|
|
15492
|
+
"bytesInOutput": 7705
|
|
15493
|
+
},
|
|
15494
|
+
"dist/form-presentation.js": {
|
|
15495
|
+
"bytesInOutput": 7085
|
|
15496
|
+
},
|
|
15497
|
+
"dist/layout.js": {
|
|
15498
|
+
"bytesInOutput": 2839
|
|
15364
15499
|
},
|
|
15365
15500
|
"node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js": {
|
|
15366
15501
|
"bytesInOutput": 1376
|
|
@@ -15579,16 +15714,19 @@
|
|
|
15579
15714
|
"bytesInOutput": 2134
|
|
15580
15715
|
},
|
|
15581
15716
|
"dist/source-document.js": {
|
|
15582
|
-
"bytesInOutput":
|
|
15717
|
+
"bytesInOutput": 16059
|
|
15583
15718
|
},
|
|
15584
15719
|
"dist/source-schema-hints.js": {
|
|
15585
15720
|
"bytesInOutput": 449
|
|
15586
15721
|
},
|
|
15587
15722
|
"dist/source-view.js": {
|
|
15588
|
-
"bytesInOutput":
|
|
15723
|
+
"bytesInOutput": 27558
|
|
15724
|
+
},
|
|
15725
|
+
"dist/schema-presentation.js": {
|
|
15726
|
+
"bytesInOutput": 4862
|
|
15589
15727
|
},
|
|
15590
15728
|
"dist/source-editor.js": {
|
|
15591
|
-
"bytesInOutput":
|
|
15729
|
+
"bytesInOutput": 11809
|
|
15592
15730
|
},
|
|
15593
15731
|
"dist/fixed-input-view.js": {
|
|
15594
15732
|
"bytesInOutput": 10479
|
|
@@ -16666,15 +16804,18 @@
|
|
|
16666
16804
|
},
|
|
16667
16805
|
"dist/schema-view.js": {
|
|
16668
16806
|
"bytesInOutput": 4302
|
|
16807
|
+
},
|
|
16808
|
+
"dist/rjsf-templates.js": {
|
|
16809
|
+
"bytesInOutput": 11025
|
|
16669
16810
|
}
|
|
16670
16811
|
},
|
|
16671
|
-
"bytes":
|
|
16812
|
+
"bytes": 896744
|
|
16672
16813
|
},
|
|
16673
16814
|
"dist/webpack4/react.js.map": {
|
|
16674
16815
|
"imports": [],
|
|
16675
16816
|
"exports": [],
|
|
16676
16817
|
"inputs": {},
|
|
16677
|
-
"bytes":
|
|
16818
|
+
"bytes": 30867
|
|
16678
16819
|
},
|
|
16679
16820
|
"dist/webpack4/react.js": {
|
|
16680
16821
|
"imports": [
|
|
@@ -16702,16 +16843,16 @@
|
|
|
16702
16843
|
"bytesInOutput": 3769
|
|
16703
16844
|
},
|
|
16704
16845
|
"dist/react.js": {
|
|
16705
|
-
"bytesInOutput":
|
|
16846
|
+
"bytesInOutput": 13029
|
|
16706
16847
|
}
|
|
16707
16848
|
},
|
|
16708
|
-
"bytes":
|
|
16849
|
+
"bytes": 17088
|
|
16709
16850
|
},
|
|
16710
16851
|
"dist/webpack4/turbowarp.js.map": {
|
|
16711
16852
|
"imports": [],
|
|
16712
16853
|
"exports": [],
|
|
16713
16854
|
"inputs": {},
|
|
16714
|
-
"bytes":
|
|
16855
|
+
"bytes": 118563
|
|
16715
16856
|
},
|
|
16716
16857
|
"dist/webpack4/turbowarp.js": {
|
|
16717
16858
|
"imports": [
|
|
@@ -16762,19 +16903,19 @@
|
|
|
16762
16903
|
"bytesInOutput": 2576
|
|
16763
16904
|
},
|
|
16764
16905
|
"dist/turbowarp/appearance.js": {
|
|
16765
|
-
"bytesInOutput":
|
|
16906
|
+
"bytesInOutput": 1884
|
|
16766
16907
|
},
|
|
16767
16908
|
"dist/turbowarp/error-session.js": {
|
|
16768
16909
|
"bytesInOutput": 835
|
|
16769
16910
|
},
|
|
16770
16911
|
"dist/turbowarp/bridge.js": {
|
|
16771
|
-
"bytesInOutput":
|
|
16912
|
+
"bytesInOutput": 7193
|
|
16772
16913
|
},
|
|
16773
16914
|
"dist/turbowarp.js": {
|
|
16774
|
-
"bytesInOutput":
|
|
16915
|
+
"bytesInOutput": 1134
|
|
16775
16916
|
}
|
|
16776
16917
|
},
|
|
16777
|
-
"bytes":
|
|
16918
|
+
"bytes": 63580
|
|
16778
16919
|
},
|
|
16779
16920
|
"dist/webpack4/shared-FYUILHED.js.map": {
|
|
16780
16921
|
"imports": [],
|
package/dist/webpack4/react.js
CHANGED
|
@@ -314,6 +314,7 @@ var BlockEditorDialog = class extends React.Component {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
render() {
|
|
317
|
+
var _a, _b, _c, _d;
|
|
317
318
|
const { styles, messages, ModalComponent, session } = this.props;
|
|
318
319
|
const saving = this.state.status === "saving";
|
|
319
320
|
const hierarchy = typeof session.getNodes === "function";
|
|
@@ -321,13 +322,18 @@ var BlockEditorDialog = class extends React.Component {
|
|
|
321
322
|
if (session.getFixedInputView && (this.state.status === "editing" || saving)) {
|
|
322
323
|
try {
|
|
323
324
|
fixed = Boolean(session.getFixedInputView());
|
|
324
|
-
} catch (
|
|
325
|
+
} catch (_e) {
|
|
325
326
|
fixed = true;
|
|
326
327
|
}
|
|
327
328
|
}
|
|
329
|
+
const root = (_a = session.getNodes) === null || _a === void 0 ? void 0 : _a.call(session).find((node) => node.inputPath.length === 0);
|
|
330
|
+
const rootId = ((_b = session.reference) === null || _b === void 0 ? void 0 : _b.blockId) || (root === null || root === void 0 ? void 0 : root.reference.blockId);
|
|
331
|
+
const appearance = rootId ? (_c = this.props.nodeAppearances) === null || _c === void 0 ? void 0 : _c[rootId] : void 0;
|
|
332
|
+
const name = (appearance === null || appearance === void 0 ? void 0 : appearance.name) || (rootId ? (_d = this.props.nodeLabels) === null || _d === void 0 ? void 0 : _d[rootId] : void 0) || (root === null || root === void 0 ? void 0 : root.opcode);
|
|
333
|
+
const title = name ? messages.title.includes("{name}") ? messages.title.replace("{name}", () => name) : /ブロック|block/i.test(messages.title) ? messages.title.replace(/ブロック|block/i, () => name) : `${name}: ${messages.title}` : messages.title;
|
|
328
334
|
return React.createElement(
|
|
329
335
|
ModalComponent,
|
|
330
|
-
{ className: `${styles.modalContent || ""} ${hierarchy ? styles.hierarchyModal : ""} ${this.props.className || ""}`, contentLabel:
|
|
336
|
+
{ className: `${styles.modalContent || ""} ${hierarchy ? styles.hierarchyModal : ""} ${this.props.className || ""}`, contentLabel: title, ...(appearance === null || appearance === void 0 ? void 0 : appearance.iconURI) ? { headerImage: appearance.iconURI } : {}, headerClassName: styles.header, id: "blockEditorModal", onRequestClose: this.handleClose },
|
|
331
337
|
React.createElement(
|
|
332
338
|
"div",
|
|
333
339
|
{ "aria-busy": saving, className: styles.body, onCompositionStart: () => {
|
|
@@ -349,14 +355,14 @@ var BlockEditorDialog = class extends React.Component {
|
|
|
349
355
|
{ "aria-live": "polite", className: styles.errors, role: "status" },
|
|
350
356
|
saving ? messages.saving : null,
|
|
351
357
|
fixed && this.state.issues.length ? React.createElement("p", null, messages.invalidInput || messages.failed) : this.state.issues.map((issue, index) => {
|
|
352
|
-
var
|
|
358
|
+
var _a2;
|
|
353
359
|
return hierarchy && "reference" in issue ? React.createElement(
|
|
354
360
|
"button",
|
|
355
361
|
{ className: styles.nodeError, "data-block-editor-issue": index, disabled: saving, key: index, type: "button", onClick: () => {
|
|
356
|
-
var
|
|
357
|
-
return (
|
|
362
|
+
var _a3;
|
|
363
|
+
return (_a3 = this.tree) === null || _a3 === void 0 ? void 0 : _a3.reveal(issue);
|
|
358
364
|
} },
|
|
359
|
-
((
|
|
365
|
+
((_a2 = this.props.nodeLabels) === null || _a2 === void 0 ? void 0 : _a2[issue.reference.blockId]) || issue.reference.blockId,
|
|
360
366
|
": ",
|
|
361
367
|
issue.message
|
|
362
368
|
) : React.createElement("p", { key: index }, issue.message);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../field-errors.js", "../react.js"],
|
|
4
|
-
"sourcesContent": ["// RJSF owns validation and messages; this adapter only decorates its rendered errors.\nconst bindBlockEditorFieldErrors = (container) => {\n const originals = new Map();\n const originalValue = (element, name) => {\n const values = originals.get(element);\n const previous = values && values.get(name);\n const current = element.getAttribute(name);\n return previous && current === previous.applied ? previous.original : current;\n };\n const setAttribute = (element, name, value) => {\n if (element.getAttribute(name) === value)\n return;\n const original = originalValue(element, name);\n if (!originals.has(element))\n originals.set(element, new Map());\n originals.get(element).set(name, { original, applied: value });\n element.setAttribute(name, value);\n };\n const restore = (element) => {\n for (const [name, { original, applied }] of originals.get(element)) {\n // Do not overwrite attributes subsequently changed by RJSF or a custom widget.\n if (element.getAttribute(name) !== applied)\n continue;\n if (original === null)\n element.removeAttribute(name);\n else\n element.setAttribute(name, original);\n }\n originals.delete(element);\n };\n const sync = () => {\n const invalid = new Set();\n const decorate = (element, messages, group = false) => {\n invalid.add(element);\n setAttribute(element, 'aria-invalid', 'true');\n setAttribute(element, 'data-block-editor-invalid', group ? 'group' : 'true');\n const descriptions = new Set((originalValue(element, 'aria-describedby') || '')\n .split(/\\s+/).filter(Boolean));\n for (const message of messages)\n descriptions.add(message.id);\n setAttribute(element, 'aria-describedby', [...descriptions].join(' '));\n if (group && !originalValue(element, 'role'))\n setAttribute(element, 'role', 'group');\n if (group && !element.hasAttribute('aria-label') && !originalValue(element, 'aria-labelledby')) {\n const titles = messages.map(message => message.id.replace(/__error$/, '__title'))\n .filter(id => {\n const title = element.ownerDocument.getElementById(id);\n return title && element.contains(title);\n });\n if (titles.length)\n setAttribute(element, 'aria-labelledby', titles.join(' '));\n }\n };\n for (const field of container.querySelectorAll('.rjsf .field.has-error')) {\n const messages = [...field.querySelectorAll('.error-detail[id]')].filter(message => { var _a; return message.closest('.field') === field && ((_a = message.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });\n if (!messages.length)\n continue;\n if (field.classList.contains('field-object') || field.classList.contains('field-array')) {\n // Group constraints must not mark otherwise valid descendant controls as invalid.\n decorate(field, messages, true);\n continue;\n }\n for (const control of field.querySelectorAll('input:not([type=\"hidden\"]), select, textarea')) {\n if (control.closest('.field') !== field)\n continue;\n const descriptions = (control.getAttribute('aria-describedby') || '').split(/\\s+/);\n const ownMessages = messages.filter(message => descriptions.includes(message.id) ||\n message.id === `${control.id}__error`);\n if (ownMessages.length)\n decorate(control, ownMessages);\n }\n }\n for (const element of originals.keys()) {\n if (!invalid.has(element))\n restore(element);\n }\n };\n const observer = new container.ownerDocument.defaultView.MutationObserver(sync);\n observer.observe(container, { childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: ['class', 'id'] });\n sync();\n return () => {\n observer.disconnect();\n for (const element of originals.keys())\n restore(element);\n };\n};\nexport default bindBlockEditorFieldErrors;\n", "import bindBlockEditorFieldErrors from './field-errors.js';\nexport { default as bindBlockEditorFieldErrors } from './field-errors.js';\nimport * as React from 'react';\nimport { BlockEditorConflictError } from './types.js';\nimport { BlockEditorStructureError } from './descendant-types.js';\nclass NodeBody extends React.Component {\n constructor() {\n super(...arguments);\n this.body = null;\n }\n componentDidMount() {\n try {\n this.unmountBody = this.props.editor.mount(this.body);\n }\n catch (error) {\n this.props.onError(error);\n }\n }\n componentWillUnmount() {\n var _a;\n try {\n (_a = this.unmountBody) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n catch (error) {\n this.props.onError(error);\n }\n }\n render() { return React.createElement(\"div\", { ref: body => { this.body = body; } }); }\n}\nlet nextBodyId = 0;\nclass DescendantTree extends React.Component {\n constructor(props) {\n super(props);\n this.nodes = this.props.session.getNodes();\n this.children = new Map();\n this.sections = new Map();\n this.bodyIds = new Map();\n for (const node of this.nodes) {\n const path = node.inputPath;\n const parent = path.length ? path[path.length - 1].blockId : null;\n if (!this.children.has(parent))\n this.children.set(parent, []);\n this.children.get(parent).push(node);\n this.bodyIds.set(node.reference.blockId, `block-editor-node-${++nextBodyId}`);\n }\n this.state = { failedIcons: new Set(), expanded: new Set(this.nodes.filter(node => this.nodes.length <= 30 || node.inputPath.length === 0).map(node => node.reference.blockId)) };\n }\n componentWillUnmount() {\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n }\n reveal(issue) {\n if (!issue || !('reference' in issue))\n return;\n const expanded = new Set(this.state.expanded);\n for (const step of issue.inputPath)\n expanded.add(step.blockId);\n expanded.add(issue.reference.blockId);\n this.setState({ expanded }, () => {\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n this.focusFrame = requestAnimationFrame(() => {\n var _a;\n const section = this.sections.get(issue.reference.blockId);\n if (!section)\n return;\n const controls = [...section.querySelectorAll('input, textarea, select')];\n const path = (issue.path || '').replace(/^\\./, '').replace(/\\[(\\d+)\\]/g, '_$1').replace(/\\./g, '_');\n const field = controls.find(control => path && control.id.endsWith(`_${path}`)) || controls[0];\n const target = field || section.querySelector('button');\n target === null || target === void 0 ? void 0 : target.focus();\n (_a = target === null || target === void 0 ? void 0 : target.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(target, { block: 'nearest' });\n });\n });\n }\n toggle(id) {\n const expanded = new Set(this.state.expanded);\n if (expanded.has(id))\n expanded.delete(id);\n else\n expanded.add(id);\n this.setState({ expanded });\n }\n renderNode(node) {\n var _a, _b, _c;\n const { styles, session, messages } = this.props;\n const id = node.reference.blockId;\n const expanded = this.state.expanded.has(id);\n const editor = (_a = session.getEditor) === null || _a === void 0 ? void 0 : _a.call(session, id);\n const step = node.inputPath[node.inputPath.length - 1];\n const appearance = ((_b = this.props.nodeAppearances) === null || _b === void 0 ? void 0 : _b[id]) || {};\n const label = appearance.name || ((_c = this.props.nodeLabels) === null || _c === void 0 ? void 0 : _c[id]) || node.opcode;\n const style = {\n '--block-editor-node-colour': appearance.colour,\n '--block-editor-node-tint': appearance.tint\n };\n return React.createElement(\"section\", { className: styles.treeNode, \"data-block-editor-node\": id, key: id, style: style, ref: section => { if (section)\n this.sections.set(id, section);\n else\n this.sections.delete(id); } },\n React.createElement(\"h3\", { className: styles.nodeHeading },\n React.createElement(\"button\", { \"aria-controls\": this.bodyIds.get(id), \"aria-expanded\": expanded, \"data-block-editor-toggle\": id, disabled: this.props.disabled, type: \"button\", onClick: () => this.toggle(id) },\n React.createElement(\"span\", { \"aria-hidden\": \"true\" }, expanded ? '\u25BE ' : '\u25B8 '),\n appearance.iconURI && !this.state.failedIcons.has(id) ? React.createElement(\"img\", { alt: \"\", \"aria-hidden\": \"true\", className: styles.nodeIcon, \"data-block-editor-node-icon\": id, draggable: false, src: appearance.iconURI, onError: () => this.setState(state => ({ failedIcons: new Set([...state.failedIcons, id]) })) }) : null,\n React.createElement(\"span\", { className: styles.nodeCaption },\n React.createElement(\"span\", { \"data-block-editor-node-name\": id }, label),\n React.createElement(\"span\", { className: styles.nodeIdentity },\n step ? React.createElement(\"span\", { className: styles.branchName }, `${step.input} \u00B7 ${step.index + 1}: `) : null,\n id)))),\n React.createElement(\"div\", { hidden: !expanded, id: this.bodyIds.get(id) }, expanded ? React.createElement(React.Fragment, null,\n editor ? React.createElement(NodeBody, { editor: editor, onError: this.props.onError }) :\n React.createElement(\"p\", { className: styles.structuralNode }, messages.structuralNode),\n (this.children.get(id) || []).map(child => this.renderNode(child))) : null));\n }\n render() {\n return React.createElement(\"div\", { className: this.props.styles.tree }, (this.children.get(null) || []).map(node => this.renderNode(node)));\n }\n}\n/** The host injects its modal, localized strings and stylesheet mapping; no GUI imports are needed. */\nexport class BlockEditorDialog extends React.Component {\n constructor(props) {\n super(props);\n this.mounted = false;\n this.unmounting = false;\n this.composing = false;\n this.body = null;\n this.tree = null;\n this.removeListener = () => { };\n this.handleBody = (body) => {\n this.body = body;\n if (this.mounted)\n this.mountBody();\n };\n this.handleMountError = (error) => {\n var _a, _b;\n (_b = (_a = this.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);\n if (!this.unmounting)\n this.setState({ mountFailed: true });\n };\n this.handleClose = () => {\n if (this.props.session.cancel())\n return;\n if (this.props.session.getState().status !== 'saving')\n this.props.onClose();\n };\n this.handleSave = async () => {\n var _a;\n const result = await this.props.session.save();\n if (result.status === 'saved')\n this.props.onClose();\n if (result.status === 'invalid')\n (_a = this.tree) === null || _a === void 0 ? void 0 : _a.reveal(result.issues[0]);\n };\n this.state = { ...props.session.getState(), mountFailed: false };\n }\n componentDidMount() {\n this.mounted = true;\n this.removeListener = this.props.session.subscribe(() => {\n const state = this.props.session.getState();\n this.setState(state);\n if (['cancelled', 'disposed', 'invalidated'].includes(state.status))\n this.props.onClose();\n });\n this.mountBody();\n }\n componentWillUnmount() {\n var _a, _b, _c, _d;\n this.unmounting = true;\n this.mounted = false;\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n this.removeListener();\n (_a = this.stopFieldErrors) === null || _a === void 0 ? void 0 : _a.call(this);\n try {\n (_b = this.unmountBody) === null || _b === void 0 ? void 0 : _b.call(this);\n }\n catch (error) {\n (_d = (_c = this.props).onError) === null || _d === void 0 ? void 0 : _d.call(_c, error);\n }\n finally {\n this.props.session.dispose();\n }\n }\n mountBody() {\n if (!this.body || this.unmountBody || this.state.mountFailed)\n return;\n try {\n if (!this.stopFieldErrors)\n this.stopFieldErrors = bindBlockEditorFieldErrors(this.body);\n if (typeof this.props.session.getNodes !== 'function')\n this.unmountBody = this.props.session.mount(this.body);\n // The modal establishes its focus scope after creating the portal.\n this.focusFrame = requestAnimationFrame(() => {\n if (!this.mounted)\n return;\n const first = this.body.querySelector('input, textarea, select') ||\n this.body.querySelector('button, [tabindex=\"0\"]');\n first === null || first === void 0 ? void 0 : first.focus();\n });\n }\n catch (error) {\n this.handleMountError(error);\n }\n }\n render() {\n const { styles, messages, ModalComponent, session } = this.props;\n const saving = this.state.status === 'saving';\n const hierarchy = typeof session.getNodes === 'function';\n let fixed = false;\n if (session.getFixedInputView && (this.state.status === 'editing' || saving)) {\n try {\n fixed = Boolean(session.getFixedInputView());\n }\n catch (_a) {\n fixed = true;\n }\n }\n return React.createElement(ModalComponent, { className: `${styles.modalContent || ''} ${hierarchy ? styles.hierarchyModal : ''} ${this.props.className || ''}`, contentLabel: messages.title, id: \"blockEditorModal\", onRequestClose: this.handleClose },\n React.createElement(\"div\", { \"aria-busy\": saving, className: styles.body, onCompositionStart: () => { this.composing = true; }, onCompositionEnd: () => { this.composing = false; }, onKeyDownCapture: event => {\n if (this.composing || event.nativeEvent.isComposing || event.keyCode === 229)\n event.stopPropagation();\n } },\n React.createElement(\"div\", { className: styles.editorBody },\n React.createElement(\"div\", { ref: this.handleBody }, hierarchy ? React.createElement(DescendantTree, { session: session, styles: styles, messages: messages, disabled: saving, nodeAppearances: this.props.nodeAppearances, nodeLabels: this.props.nodeLabels, onError: this.handleMountError, ref: tree => { this.tree = tree; } }) : null),\n React.createElement(\"div\", { \"aria-live\": \"polite\", className: styles.errors, role: \"status\" },\n saving ? messages.saving : null,\n fixed && this.state.issues.length ? React.createElement(\"p\", null, messages.invalidInput || messages.failed) : this.state.issues.map((issue, index) => {\n var _a;\n return hierarchy && 'reference' in issue ?\n React.createElement(\"button\", { className: styles.nodeError, \"data-block-editor-issue\": index, disabled: saving, key: index, type: \"button\", onClick: () => { var _a; return (_a = this.tree) === null || _a === void 0 ? void 0 : _a.reveal(issue); } },\n ((_a = this.props.nodeLabels) === null || _a === void 0 ? void 0 : _a[issue.reference.blockId]) || issue.reference.blockId,\n ': ',\n issue.message) : React.createElement(\"p\", { key: index }, issue.message);\n }),\n this.state.error instanceof BlockEditorStructureError ? messages.structureError :\n this.state.error instanceof BlockEditorConflictError ? messages.conflict :\n (this.state.error || this.state.mountFailed) ? messages.failed : null)),\n React.createElement(\"div\", { className: styles.buttons },\n React.createElement(\"button\", { disabled: saving, type: \"button\", onClick: this.handleClose }, messages.cancel),\n React.createElement(\"button\", { \"data-block-editor-save\": \"\", disabled: !this.state.canSave || this.state.mountFailed, type: \"button\", onClick: this.handleSave }, saving ? messages.saving : hierarchy ? messages.saveAll : messages.save))));\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;AACA,IAAM,6BAA6B,CAAC,cAAc;AAC9C,QAAM,YAAY,oBAAI,IAAI;AAC1B,QAAM,gBAAgB,CAAC,SAAS,SAAS;AACrC,UAAM,SAAS,UAAU,IAAI,OAAO;AACpC,UAAM,WAAW,UAAU,OAAO,IAAI,IAAI;AAC1C,UAAM,UAAU,QAAQ,aAAa,IAAI;AACzC,WAAO,YAAY,YAAY,SAAS,UAAU,SAAS,WAAW;AAAA,EAC1E;AACA,QAAM,eAAe,CAAC,SAAS,MAAM,UAAU;AAC3C,QAAI,QAAQ,aAAa,IAAI,MAAM;AAC/B;AACJ,UAAM,WAAW,cAAc,SAAS,IAAI;AAC5C,QAAI,CAAC,UAAU,IAAI,OAAO;AACtB,gBAAU,IAAI,SAAS,oBAAI,IAAI,CAAC;AACpC,cAAU,IAAI,OAAO,EAAE,IAAI,MAAM,EAAE,UAAU,SAAS,MAAM,CAAC;AAC7D,YAAQ,aAA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gBAAgB,SAAS,MAAM,IAAI,KAAK,MAAM,OAAO,IAAI,CAAC,OAAO,UAAU;AACnJ,kBAAI;AACJ,qBAAO,aAAa,eAAe,QACzB;AAAA,gBAAc;AAAA,gBAAU,EAAE,WAAW,OAAO,WAAW,2BAA2B,OAAO,UAAU,QAAQ,KAAK,OAAO,MAAM,UAAU,SAAS,MAAM;AAAE,sBAAIA;AAAI,0BAAQA,MAAK,KAAK,UAAU,QAAQA,QAAO,SAAS,SAASA,IAAG,OAAO,KAAK;AAAA,gBAAG,EAAE;AAAA,kBACjP,KAAK,KAAK,MAAM,gBAAgB,QAAQ,OAAO,SAAS,SAAS,GAAG,MAAM,UAAU,OAAO,MAAM,MAAM,UAAU;AAAA,gBACnH;AAAA,gBACA,MAAM;AAAA,cAAO,IAAU,oBAAc,KAAK,EAAE,KAAK,MAAM,GAAG,MAAM,OAAO;AAAA,YACnF,CAAC;AAAA,YACD,KAAK,MAAM,iBAAiB,4BAA4B,SAAS,iBAC7D,KAAK,MAAM,iBAAiB,2BAA2B,SAAS,WAC3D,KAAK,MAAM,SAAS,KAAK,MAAM,cAAe,SAAS,SAAS;AAAA,UAAI;AAAA,QAAC;AAAA,QAChF;AAAA,UAAc;AAAA,UAAO,EAAE,WAAW,OAAO,QAAQ;AAAA,UAC7C,oBAAc,UAAU,EAAE,UAAU,QAAQ,MAAM,UAAU,SAAS,KAAK,YAAY,GAAG,SAAS,MAAM;AAAA,UACxG,oBAAc,UAAU,EAAE,0BAA0B,IAAI,UAAU,CAAC,KAAK,MAAM,WAAW,KAAK,MAAM,aAAa,MAAM,UAAU,SAAS,KAAK,WAAW,GAAG,SAAS,SAAS,SAAS,YAAY,SAAS,UAAU,SAAS,IAAI;AAAA,QAAC;AAAA,MAAC;AAAA,IAAC;AAAA,EAC7P;AACJ;",
|
|
4
|
+
"sourcesContent": ["// RJSF owns validation and messages; this adapter only decorates its rendered errors.\nconst bindBlockEditorFieldErrors = (container) => {\n const originals = new Map();\n const originalValue = (element, name) => {\n const values = originals.get(element);\n const previous = values && values.get(name);\n const current = element.getAttribute(name);\n return previous && current === previous.applied ? previous.original : current;\n };\n const setAttribute = (element, name, value) => {\n if (element.getAttribute(name) === value)\n return;\n const original = originalValue(element, name);\n if (!originals.has(element))\n originals.set(element, new Map());\n originals.get(element).set(name, { original, applied: value });\n element.setAttribute(name, value);\n };\n const restore = (element) => {\n for (const [name, { original, applied }] of originals.get(element)) {\n // Do not overwrite attributes subsequently changed by RJSF or a custom widget.\n if (element.getAttribute(name) !== applied)\n continue;\n if (original === null)\n element.removeAttribute(name);\n else\n element.setAttribute(name, original);\n }\n originals.delete(element);\n };\n const sync = () => {\n const invalid = new Set();\n const decorate = (element, messages, group = false) => {\n invalid.add(element);\n setAttribute(element, 'aria-invalid', 'true');\n setAttribute(element, 'data-block-editor-invalid', group ? 'group' : 'true');\n const descriptions = new Set((originalValue(element, 'aria-describedby') || '')\n .split(/\\s+/).filter(Boolean));\n for (const message of messages)\n descriptions.add(message.id);\n setAttribute(element, 'aria-describedby', [...descriptions].join(' '));\n if (group && !originalValue(element, 'role'))\n setAttribute(element, 'role', 'group');\n if (group && !element.hasAttribute('aria-label') && !originalValue(element, 'aria-labelledby')) {\n const titles = messages.map(message => message.id.replace(/__error$/, '__title'))\n .filter(id => {\n const title = element.ownerDocument.getElementById(id);\n return title && element.contains(title);\n });\n if (titles.length)\n setAttribute(element, 'aria-labelledby', titles.join(' '));\n }\n };\n for (const field of container.querySelectorAll('.rjsf .field.has-error')) {\n const messages = [...field.querySelectorAll('.error-detail[id]')].filter(message => { var _a; return message.closest('.field') === field && ((_a = message.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });\n if (!messages.length)\n continue;\n if (field.classList.contains('field-object') || field.classList.contains('field-array')) {\n // Group constraints must not mark otherwise valid descendant controls as invalid.\n decorate(field, messages, true);\n continue;\n }\n for (const control of field.querySelectorAll('input:not([type=\"hidden\"]), select, textarea')) {\n if (control.closest('.field') !== field)\n continue;\n const descriptions = (control.getAttribute('aria-describedby') || '').split(/\\s+/);\n const ownMessages = messages.filter(message => descriptions.includes(message.id) ||\n message.id === `${control.id}__error`);\n if (ownMessages.length)\n decorate(control, ownMessages);\n }\n }\n for (const element of originals.keys()) {\n if (!invalid.has(element))\n restore(element);\n }\n };\n const observer = new container.ownerDocument.defaultView.MutationObserver(sync);\n observer.observe(container, { childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: ['class', 'id'] });\n sync();\n return () => {\n observer.disconnect();\n for (const element of originals.keys())\n restore(element);\n };\n};\nexport default bindBlockEditorFieldErrors;\n", "import bindBlockEditorFieldErrors from './field-errors.js';\nexport { default as bindBlockEditorFieldErrors } from './field-errors.js';\nimport * as React from 'react';\nimport { BlockEditorConflictError } from './types.js';\nimport { BlockEditorStructureError } from './descendant-types.js';\nclass NodeBody extends React.Component {\n constructor() {\n super(...arguments);\n this.body = null;\n }\n componentDidMount() {\n try {\n this.unmountBody = this.props.editor.mount(this.body);\n }\n catch (error) {\n this.props.onError(error);\n }\n }\n componentWillUnmount() {\n var _a;\n try {\n (_a = this.unmountBody) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n catch (error) {\n this.props.onError(error);\n }\n }\n render() { return React.createElement(\"div\", { ref: body => { this.body = body; } }); }\n}\nlet nextBodyId = 0;\nclass DescendantTree extends React.Component {\n constructor(props) {\n super(props);\n this.nodes = this.props.session.getNodes();\n this.children = new Map();\n this.sections = new Map();\n this.bodyIds = new Map();\n for (const node of this.nodes) {\n const path = node.inputPath;\n const parent = path.length ? path[path.length - 1].blockId : null;\n if (!this.children.has(parent))\n this.children.set(parent, []);\n this.children.get(parent).push(node);\n this.bodyIds.set(node.reference.blockId, `block-editor-node-${++nextBodyId}`);\n }\n this.state = { failedIcons: new Set(), expanded: new Set(this.nodes.filter(node => this.nodes.length <= 30 || node.inputPath.length === 0).map(node => node.reference.blockId)) };\n }\n componentWillUnmount() {\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n }\n reveal(issue) {\n if (!issue || !('reference' in issue))\n return;\n const expanded = new Set(this.state.expanded);\n for (const step of issue.inputPath)\n expanded.add(step.blockId);\n expanded.add(issue.reference.blockId);\n this.setState({ expanded }, () => {\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n this.focusFrame = requestAnimationFrame(() => {\n var _a;\n const section = this.sections.get(issue.reference.blockId);\n if (!section)\n return;\n const controls = [...section.querySelectorAll('input, textarea, select')];\n const path = (issue.path || '').replace(/^\\./, '').replace(/\\[(\\d+)\\]/g, '_$1').replace(/\\./g, '_');\n const field = controls.find(control => path && control.id.endsWith(`_${path}`)) || controls[0];\n const target = field || section.querySelector('button');\n target === null || target === void 0 ? void 0 : target.focus();\n (_a = target === null || target === void 0 ? void 0 : target.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(target, { block: 'nearest' });\n });\n });\n }\n toggle(id) {\n const expanded = new Set(this.state.expanded);\n if (expanded.has(id))\n expanded.delete(id);\n else\n expanded.add(id);\n this.setState({ expanded });\n }\n renderNode(node) {\n var _a, _b, _c;\n const { styles, session, messages } = this.props;\n const id = node.reference.blockId;\n const expanded = this.state.expanded.has(id);\n const editor = (_a = session.getEditor) === null || _a === void 0 ? void 0 : _a.call(session, id);\n const step = node.inputPath[node.inputPath.length - 1];\n const appearance = ((_b = this.props.nodeAppearances) === null || _b === void 0 ? void 0 : _b[id]) || {};\n const label = appearance.name || ((_c = this.props.nodeLabels) === null || _c === void 0 ? void 0 : _c[id]) || node.opcode;\n const style = {\n '--block-editor-node-colour': appearance.colour,\n '--block-editor-node-tint': appearance.tint\n };\n return React.createElement(\"section\", { className: styles.treeNode, \"data-block-editor-node\": id, key: id, style: style, ref: section => { if (section)\n this.sections.set(id, section);\n else\n this.sections.delete(id); } },\n React.createElement(\"h3\", { className: styles.nodeHeading },\n React.createElement(\"button\", { \"aria-controls\": this.bodyIds.get(id), \"aria-expanded\": expanded, \"data-block-editor-toggle\": id, disabled: this.props.disabled, type: \"button\", onClick: () => this.toggle(id) },\n React.createElement(\"span\", { \"aria-hidden\": \"true\" }, expanded ? '\u25BE ' : '\u25B8 '),\n appearance.iconURI && !this.state.failedIcons.has(id) ? React.createElement(\"img\", { alt: \"\", \"aria-hidden\": \"true\", className: styles.nodeIcon, \"data-block-editor-node-icon\": id, draggable: false, src: appearance.iconURI, onError: () => this.setState(state => ({ failedIcons: new Set([...state.failedIcons, id]) })) }) : null,\n React.createElement(\"span\", { className: styles.nodeCaption },\n React.createElement(\"span\", { \"data-block-editor-node-name\": id }, label),\n React.createElement(\"span\", { className: styles.nodeIdentity },\n step ? React.createElement(\"span\", { className: styles.branchName }, `${step.input} \u00B7 ${step.index + 1}: `) : null,\n id)))),\n React.createElement(\"div\", { hidden: !expanded, id: this.bodyIds.get(id) }, expanded ? React.createElement(React.Fragment, null,\n editor ? React.createElement(NodeBody, { editor: editor, onError: this.props.onError }) :\n React.createElement(\"p\", { className: styles.structuralNode }, messages.structuralNode),\n (this.children.get(id) || []).map(child => this.renderNode(child))) : null));\n }\n render() {\n return React.createElement(\"div\", { className: this.props.styles.tree }, (this.children.get(null) || []).map(node => this.renderNode(node)));\n }\n}\n/** The host injects its modal, localized strings and stylesheet mapping; no GUI imports are needed. */\nexport class BlockEditorDialog extends React.Component {\n constructor(props) {\n super(props);\n this.mounted = false;\n this.unmounting = false;\n this.composing = false;\n this.body = null;\n this.tree = null;\n this.removeListener = () => { };\n this.handleBody = (body) => {\n this.body = body;\n if (this.mounted)\n this.mountBody();\n };\n this.handleMountError = (error) => {\n var _a, _b;\n (_b = (_a = this.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);\n if (!this.unmounting)\n this.setState({ mountFailed: true });\n };\n this.handleClose = () => {\n if (this.props.session.cancel())\n return;\n if (this.props.session.getState().status !== 'saving')\n this.props.onClose();\n };\n this.handleSave = async () => {\n var _a;\n const result = await this.props.session.save();\n if (result.status === 'saved')\n this.props.onClose();\n if (result.status === 'invalid')\n (_a = this.tree) === null || _a === void 0 ? void 0 : _a.reveal(result.issues[0]);\n };\n this.state = { ...props.session.getState(), mountFailed: false };\n }\n componentDidMount() {\n this.mounted = true;\n this.removeListener = this.props.session.subscribe(() => {\n const state = this.props.session.getState();\n this.setState(state);\n if (['cancelled', 'disposed', 'invalidated'].includes(state.status))\n this.props.onClose();\n });\n this.mountBody();\n }\n componentWillUnmount() {\n var _a, _b, _c, _d;\n this.unmounting = true;\n this.mounted = false;\n if (this.focusFrame !== undefined)\n cancelAnimationFrame(this.focusFrame);\n this.removeListener();\n (_a = this.stopFieldErrors) === null || _a === void 0 ? void 0 : _a.call(this);\n try {\n (_b = this.unmountBody) === null || _b === void 0 ? void 0 : _b.call(this);\n }\n catch (error) {\n (_d = (_c = this.props).onError) === null || _d === void 0 ? void 0 : _d.call(_c, error);\n }\n finally {\n this.props.session.dispose();\n }\n }\n mountBody() {\n if (!this.body || this.unmountBody || this.state.mountFailed)\n return;\n try {\n if (!this.stopFieldErrors)\n this.stopFieldErrors = bindBlockEditorFieldErrors(this.body);\n if (typeof this.props.session.getNodes !== 'function')\n this.unmountBody = this.props.session.mount(this.body);\n // The modal establishes its focus scope after creating the portal.\n this.focusFrame = requestAnimationFrame(() => {\n if (!this.mounted)\n return;\n const first = this.body.querySelector('input, textarea, select') ||\n this.body.querySelector('button, [tabindex=\"0\"]');\n first === null || first === void 0 ? void 0 : first.focus();\n });\n }\n catch (error) {\n this.handleMountError(error);\n }\n }\n render() {\n var _a, _b, _c, _d;\n const { styles, messages, ModalComponent, session } = this.props;\n const saving = this.state.status === 'saving';\n const hierarchy = typeof session.getNodes === 'function';\n let fixed = false;\n if (session.getFixedInputView && (this.state.status === 'editing' || saving)) {\n try {\n fixed = Boolean(session.getFixedInputView());\n }\n catch (_e) {\n fixed = true;\n }\n }\n const root = (_a = session.getNodes) === null || _a === void 0 ? void 0 : _a.call(session).find(node => node.inputPath.length === 0);\n const rootId = ((_b = session.reference) === null || _b === void 0 ? void 0 : _b.blockId) || (root === null || root === void 0 ? void 0 : root.reference.blockId);\n const appearance = rootId ? (_c = this.props.nodeAppearances) === null || _c === void 0 ? void 0 : _c[rootId] : undefined;\n const name = (appearance === null || appearance === void 0 ? void 0 : appearance.name) || (rootId ? (_d = this.props.nodeLabels) === null || _d === void 0 ? void 0 : _d[rootId] : undefined) || (root === null || root === void 0 ? void 0 : root.opcode);\n const title = name ? messages.title.includes('{name}') ? messages.title.replace('{name}', () => name) :\n /\u30D6\u30ED\u30C3\u30AF|block/i.test(messages.title) ? messages.title.replace(/\u30D6\u30ED\u30C3\u30AF|block/i, () => name) :\n `${name}: ${messages.title}` : messages.title;\n return React.createElement(ModalComponent, { className: `${styles.modalContent || ''} ${hierarchy ? styles.hierarchyModal : ''} ${this.props.className || ''}`, contentLabel: title, ...((appearance === null || appearance === void 0 ? void 0 : appearance.iconURI) ? { headerImage: appearance.iconURI } : {}), headerClassName: styles.header, id: \"blockEditorModal\", onRequestClose: this.handleClose },\n React.createElement(\"div\", { \"aria-busy\": saving, className: styles.body, onCompositionStart: () => { this.composing = true; }, onCompositionEnd: () => { this.composing = false; }, onKeyDownCapture: event => {\n if (this.composing || event.nativeEvent.isComposing || event.keyCode === 229)\n event.stopPropagation();\n } },\n React.createElement(\"div\", { className: styles.editorBody },\n React.createElement(\"div\", { ref: this.handleBody }, hierarchy ? React.createElement(DescendantTree, { session: session, styles: styles, messages: messages, disabled: saving, nodeAppearances: this.props.nodeAppearances, nodeLabels: this.props.nodeLabels, onError: this.handleMountError, ref: tree => { this.tree = tree; } }) : null),\n React.createElement(\"div\", { \"aria-live\": \"polite\", className: styles.errors, role: \"status\" },\n saving ? messages.saving : null,\n fixed && this.state.issues.length ? React.createElement(\"p\", null, messages.invalidInput || messages.failed) : this.state.issues.map((issue, index) => {\n var _a;\n return hierarchy && 'reference' in issue ?\n React.createElement(\"button\", { className: styles.nodeError, \"data-block-editor-issue\": index, disabled: saving, key: index, type: \"button\", onClick: () => { var _a; return (_a = this.tree) === null || _a === void 0 ? void 0 : _a.reveal(issue); } },\n ((_a = this.props.nodeLabels) === null || _a === void 0 ? void 0 : _a[issue.reference.blockId]) || issue.reference.blockId,\n ': ',\n issue.message) : React.createElement(\"p\", { key: index }, issue.message);\n }),\n this.state.error instanceof BlockEditorStructureError ? messages.structureError :\n this.state.error instanceof BlockEditorConflictError ? messages.conflict :\n (this.state.error || this.state.mountFailed) ? messages.failed : null)),\n React.createElement(\"div\", { className: styles.buttons },\n React.createElement(\"button\", { disabled: saving, type: \"button\", onClick: this.handleClose }, messages.cancel),\n React.createElement(\"button\", { \"data-block-editor-save\": \"\", disabled: !this.state.canSave || this.state.mountFailed, type: \"button\", onClick: this.handleSave }, saving ? messages.saving : hierarchy ? messages.saveAll : messages.save))));\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AACA,IAAM,6BAA6B,CAAC,cAAc;AAC9C,QAAM,YAAY,oBAAI,IAAI;AAC1B,QAAM,gBAAgB,CAAC,SAAS,SAAS;AACrC,UAAM,SAAS,UAAU,IAAI,OAAO;AACpC,UAAM,WAAW,UAAU,OAAO,IAAI,IAAI;AAC1C,UAAM,UAAU,QAAQ,aAAa,IAAI;AACzC,WAAO,YAAY,YAAY,SAAS,UAAU,SAAS,WAAW;AAAA,EAC1E;AACA,QAAM,eAAe,CAAC,SAAS,MAAM,UAAU;AAC3C,QAAI,QAAQ,aAAa,IAAI,MAAM;AAC/B;AACJ,UAAM,WAAW,cAAc,SAAS,IAAI;AAC5C,QAAI,CAAC,UAAU,IAAI,OAAO;AACtB,gBAAU,IAAI,SAAS,oBAAI,IAAI,CAAC;AACpC,cAAU,IAAI,OAAO,EAAE,IAAI,MAAM,EAAE,UAAU,SAAS,MAAM,CAAC;AAC7D,YAAQ,aAAa,MAAM,KAAK;AAAA,EACpC;AACA,QAAM,UAAU,CAAC,YAAY;AACzB,eAAW,CAAC,MAAM,EAAE,UAAU,QAAQ,CAAC,KAAK,UAAU,IAAI,OAAO,GAAG;AAEhE,UAAI,QAAQ,aA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