@pie-element/inline-dropdown 11.0.1-next.20261002222413 → 11.0.1-next.20261003061051
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/author/defaults.d.ts +0 -8
- package/dist/author/index.d.ts +0 -8
- package/dist/author/inline-dropdown-toolbar.d.ts +0 -8
- package/dist/author/main.d.ts +0 -8
- package/dist/author/markupUtils.d.ts +0 -8
- package/dist/author/response-area.d.ts +0 -8
- package/dist/author/utils.d.ts +0 -8
- package/dist/browser/author/index.js +37 -34
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +37 -34
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +0 -8
- package/dist/controller/index.d.ts +0 -8
- package/dist/controller/utils.d.ts +0 -8
- package/dist/delivery/index.d.ts +0 -8
- package/dist/delivery/inline-dropdown.d.ts +0 -8
- package/dist/index.iife.d.ts +0 -2
- package/package.json +7 -7
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/defaults.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
declare const _default: {
|
|
10
2
|
model: {
|
|
11
3
|
alternateResponse: {};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
export default class InlineDropdown extends HTMLElement {
|
|
10
2
|
static prepareModel: (model?: {}) => {
|
|
11
3
|
slateMarkup: any;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/inline-dropdown-toolbar.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
declare class RespAreaToolbar extends React.Component {
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/main.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
export declare class Main extends React.Component {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/markupUtils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
export declare const removeUnwantedCharacters: (markup: any) => any;
|
|
10
2
|
export declare const createElementFromHTML: (htmlString: any) => HTMLDivElement;
|
|
11
3
|
export declare const processMarkup: (markup: any) => string;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/response-area.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
declare class ResponseAreaComponent extends React.Component {
|
package/dist/author/utils.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/inline-dropdown/configure/src/utils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
1
|
export declare const generateValidationMessage: (config: any) => string;
|
|
10
2
|
export declare const getPluginProps: (props?: {}, baseInputConfiguration?: {}) => {};
|
|
@@ -19465,11 +19465,20 @@ oE.propTypes = {
|
|
|
19465
19465
|
};
|
|
19466
19466
|
//#endregion
|
|
19467
19467
|
//#region ../../lib-react/editable-html-tip-tap/dist/extensions/responseArea.js
|
|
19468
|
-
var sE =
|
|
19468
|
+
var sE = (e) => String(e || "").replace(/-/g, "_"), cE = (e) => e && e.attrs && e.attrs.index != null ? String(e.attrs.index) : null, lE = (e, t) => {
|
|
19469
|
+
let n = 0;
|
|
19470
|
+
return e.descendants((e) => {
|
|
19471
|
+
if (e.type && e.type.name === t) {
|
|
19472
|
+
let t = parseInt(cE(e), 10);
|
|
19473
|
+
!Number.isNaN(t) && t > n && (n = t);
|
|
19474
|
+
}
|
|
19475
|
+
return !0;
|
|
19476
|
+
}), n;
|
|
19477
|
+
}, uE = (e, t) => {
|
|
19469
19478
|
let n = [];
|
|
19470
19479
|
return e.descendants((e, r) => {
|
|
19471
19480
|
if (e.type && e.type.name === t) {
|
|
19472
|
-
let t =
|
|
19481
|
+
let t = cE(e);
|
|
19473
19482
|
t != null && n.push({
|
|
19474
19483
|
index: t,
|
|
19475
19484
|
pos: r,
|
|
@@ -19502,59 +19511,53 @@ var sE = {}, cE = (e) => String(e || "").replace(/-/g, "_"), lE = (e) => e && e.
|
|
|
19502
19511
|
onHandleAreaChange: null
|
|
19503
19512
|
};
|
|
19504
19513
|
},
|
|
19514
|
+
addStorage() {
|
|
19515
|
+
return { lastIndexMap: {} };
|
|
19516
|
+
},
|
|
19505
19517
|
addProseMirrorPlugins() {
|
|
19506
19518
|
if (!this.options.type) return [];
|
|
19507
|
-
let e =
|
|
19519
|
+
let e = sE(this.options.type);
|
|
19508
19520
|
return [new To({
|
|
19509
19521
|
key: new Oo(`response-area-watcher:${e}`),
|
|
19510
|
-
view: (t) =>
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19522
|
+
view: (t) => {
|
|
19523
|
+
let { lastIndexMap: n } = this.storage;
|
|
19524
|
+
return n[e] = Math.max(n[e] ?? 0, lE(t.state.doc, e)), { update: (t, n) => {
|
|
19525
|
+
let r = t.state;
|
|
19526
|
+
if (n.doc.eq(r.doc)) return;
|
|
19527
|
+
let i = uE(r.doc, e), a = uE(n.doc, e);
|
|
19528
|
+
if (this.options.toolbar && (this.options.toolbar.disabled = i.length >= this.options.maxResponseAreas), a.length > i.length) {
|
|
19529
|
+
let e = new Set(i.map((e) => e.index)), t = a.filter((t) => !e.has(t.index));
|
|
19530
|
+
t.length && typeof this.options.onHandleAreaChange == "function" && this.options.onHandleAreaChange(t);
|
|
19516
19531
|
}
|
|
19517
|
-
}
|
|
19518
|
-
|
|
19519
|
-
})), { update: (t, n) => {
|
|
19520
|
-
let r = t.state;
|
|
19521
|
-
if (n.doc.eq(r.doc)) return;
|
|
19522
|
-
let i = uE(r.doc, e), a = uE(n.doc, e);
|
|
19523
|
-
if (this.options.toolbar && (this.options.toolbar.disabled = i.length >= this.options.maxResponseAreas), a.length > i.length) {
|
|
19524
|
-
let e = new Set(i.map((e) => e.index)), t = a.filter((t) => !e.has(t.index));
|
|
19525
|
-
t.length && typeof this.options.onHandleAreaChange == "function" && this.options.onHandleAreaChange(t);
|
|
19526
|
-
}
|
|
19527
|
-
} })
|
|
19532
|
+
} };
|
|
19533
|
+
}
|
|
19528
19534
|
})];
|
|
19529
19535
|
},
|
|
19530
19536
|
addCommands() {
|
|
19531
19537
|
return {
|
|
19532
19538
|
insertResponseArea: (e) => ({ tr: t, state: n, dispatch: r, commands: i }) => {
|
|
19533
|
-
let a =
|
|
19539
|
+
let a = sE(e);
|
|
19534
19540
|
if (dE(n.doc, a) >= this.options.maxResponseAreas) return !1;
|
|
19535
|
-
|
|
19536
|
-
let o = sE[a] + 1;
|
|
19537
|
-
sE[a] += 1;
|
|
19538
|
-
let s = fE({
|
|
19541
|
+
let { lastIndexMap: o } = this.storage, s = Math.max(o[a] ?? 0, lE(n.doc, a)) + 1, c = fE({
|
|
19539
19542
|
schema: n.schema,
|
|
19540
19543
|
typeName: a,
|
|
19541
|
-
index:
|
|
19544
|
+
index: s
|
|
19542
19545
|
});
|
|
19543
|
-
if (!
|
|
19544
|
-
let { selection:
|
|
19546
|
+
if (!c) return !1;
|
|
19547
|
+
let { selection: l } = n, u = l.from, d = (e) => {
|
|
19545
19548
|
try {
|
|
19546
|
-
return t.insert(e,
|
|
19549
|
+
return t.insert(e, c), e;
|
|
19547
19550
|
} catch {
|
|
19548
19551
|
return null;
|
|
19549
19552
|
}
|
|
19550
|
-
},
|
|
19551
|
-
if (
|
|
19552
|
-
if (["inline_dropdown", "explicit_constructed_response"].includes(a)) t.setSelection(B.create(t.doc,
|
|
19553
|
+
}, f = d(u);
|
|
19554
|
+
if (f ??= d(t.doc.content.size), f == null) return !1;
|
|
19555
|
+
if (["inline_dropdown", "explicit_constructed_response"].includes(a)) t.setSelection(B.create(t.doc, f));
|
|
19553
19556
|
else {
|
|
19554
|
-
let e =
|
|
19557
|
+
let e = f + c.nodeSize;
|
|
19555
19558
|
t.setSelection(pE(t.doc, e));
|
|
19556
19559
|
}
|
|
19557
|
-
return r && (i.focus(), r(t)), !0;
|
|
19560
|
+
return r && (o[a] = s, i.focus(), r(t)), !0;
|
|
19558
19561
|
},
|
|
19559
19562
|
refreshResponseArea: () => ({ tr: e, state: t, commands: n, dispatch: r }) => {
|
|
19560
19563
|
let { selection: i } = t, a = i.$from.nodeAfter, o = i.from;
|