@yungu-fed/question-editor 0.2.3 → 0.2.4
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.css +1 -1
- package/dist/index.js +948 -941
- package/dist/index.mjs +35 -32
- package/dist/question/player/QuestionPlayerComposite.d.ts.map +1 -1
- package/dist/question/preview/QuestionCompositePreview.d.ts.map +1 -1
- package/dist/question/shared/SubquestionNumberedContent.d.ts +2 -1
- package/dist/question/shared/SubquestionNumberedContent.d.ts.map +1 -1
- package/package.json +15 -15
package/dist/index.mjs
CHANGED
|
@@ -4770,20 +4770,21 @@ function Lo(e, t) {
|
|
|
4770
4770
|
return e.length > 1 || t > 1;
|
|
4771
4771
|
}
|
|
4772
4772
|
var Ro = {
|
|
4773
|
-
root: "
|
|
4774
|
-
|
|
4775
|
-
|
|
4773
|
+
root: "_root_1phv3_1",
|
|
4774
|
+
indented: "_indented_1phv3_9",
|
|
4775
|
+
number: "_number_1phv3_14",
|
|
4776
|
+
content: "_content_1phv3_22"
|
|
4776
4777
|
};
|
|
4777
4778
|
//#endregion
|
|
4778
4779
|
//#region src/question/shared/SubquestionNumberedContent.tsx
|
|
4779
|
-
function zo({ children: e,
|
|
4780
|
-
return
|
|
4781
|
-
className: Ro.root,
|
|
4780
|
+
function zo({ children: e, indented: t = !1, number: n }) {
|
|
4781
|
+
return n === null ? /* @__PURE__ */ a(i, { children: e }) : /* @__PURE__ */ o("div", {
|
|
4782
|
+
className: t ? `${Ro.root} ${Ro.indented}` : Ro.root,
|
|
4782
4783
|
"data-subquestion-numbered-content": !0,
|
|
4783
4784
|
children: [/* @__PURE__ */ a("span", {
|
|
4784
4785
|
className: Ro.number,
|
|
4785
4786
|
"data-subquestion-number": !0,
|
|
4786
|
-
children:
|
|
4787
|
+
children: n
|
|
4787
4788
|
}), /* @__PURE__ */ a("div", {
|
|
4788
4789
|
className: Ro.content,
|
|
4789
4790
|
children: e
|
|
@@ -5994,18 +5995,18 @@ function zc({ children: e }) {
|
|
|
5994
5995
|
});
|
|
5995
5996
|
}
|
|
5996
5997
|
var W = {
|
|
5997
|
-
root: "
|
|
5998
|
-
"element-list": "_element-
|
|
5999
|
-
children: "
|
|
6000
|
-
"control-list": "_control-
|
|
6001
|
-
"fill-text": "_fill-
|
|
6002
|
-
element: "
|
|
6003
|
-
extra: "
|
|
6004
|
-
child: "
|
|
6005
|
-
"field-label": "_field-
|
|
6006
|
-
empty: "
|
|
6007
|
-
input: "
|
|
6008
|
-
field: "
|
|
5998
|
+
root: "_root_1owdb_1",
|
|
5999
|
+
"element-list": "_element-list_1owdb_19",
|
|
6000
|
+
children: "_children_1owdb_20",
|
|
6001
|
+
"control-list": "_control-list_1owdb_21",
|
|
6002
|
+
"fill-text": "_fill-text_1owdb_22",
|
|
6003
|
+
element: "_element_1owdb_19",
|
|
6004
|
+
extra: "_extra_1owdb_32",
|
|
6005
|
+
child: "_child_1owdb_20",
|
|
6006
|
+
"field-label": "_field-label_1owdb_44",
|
|
6007
|
+
empty: "_empty_1owdb_50",
|
|
6008
|
+
input: "_input_1owdb_62",
|
|
6009
|
+
field: "_field_1owdb_44"
|
|
6009
6010
|
};
|
|
6010
6011
|
//#endregion
|
|
6011
6012
|
//#region src/question/player/QuestionPlayerComposite.tsx
|
|
@@ -6016,11 +6017,12 @@ function Bc({ messages: e, numberPath: t = [], onChildResponseChange: n, renderC
|
|
|
6016
6017
|
}) : /* @__PURE__ */ a("div", {
|
|
6017
6018
|
className: W.children,
|
|
6018
6019
|
children: o.children.map((s, c) => {
|
|
6019
|
-
let l = [...t, c], u = i.children.slice(c, c + 1)[0];
|
|
6020
|
+
let l = [...t, c], u = i.children.slice(c, c + 1)[0], d = Lo(l, o.children.length) ? Io(l) : null;
|
|
6020
6021
|
return /* @__PURE__ */ a("section", {
|
|
6021
6022
|
className: W.child,
|
|
6022
6023
|
children: /* @__PURE__ */ a(zo, {
|
|
6023
|
-
|
|
6024
|
+
indented: !0,
|
|
6025
|
+
number: d,
|
|
6024
6026
|
children: u ? r(s, u, (e) => n(c, e), l) : /* @__PURE__ */ a("div", {
|
|
6025
6027
|
className: W.empty,
|
|
6026
6028
|
children: e.missingQuestionTypeTemplate
|
|
@@ -7355,7 +7357,7 @@ function Kl(e) {
|
|
|
7355
7357
|
] });
|
|
7356
7358
|
}
|
|
7357
7359
|
function ql({ disabled: e, locale: t, messages: n, onResponseChange: r, response: i, showAnswer: o, structure: s, uploadImage: c, value: l }) {
|
|
7358
|
-
return /* @__PURE__ */ a("div", {
|
|
7360
|
+
return s.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7359
7361
|
className: W["element-list"],
|
|
7360
7362
|
children: s.elements.map((u, d) => {
|
|
7361
7363
|
let f = rn(l, d, u), p = s.elements.slice(0, d).filter((e) => e.type !== "richText").length;
|
|
@@ -7813,13 +7815,13 @@ function pu({ element: e, item: t, messages: n, showAnswer: r }) {
|
|
|
7813
7815
|
}
|
|
7814
7816
|
}
|
|
7815
7817
|
var mu = {
|
|
7816
|
-
root: "
|
|
7817
|
-
empty: "
|
|
7818
|
-
"element-list": "_element-
|
|
7819
|
-
children: "
|
|
7820
|
-
element: "
|
|
7821
|
-
extra: "
|
|
7822
|
-
child: "
|
|
7818
|
+
root: "_root_1jseb_1",
|
|
7819
|
+
empty: "_empty_1jseb_18",
|
|
7820
|
+
"element-list": "_element-list_1jseb_30",
|
|
7821
|
+
children: "_children_1jseb_31",
|
|
7822
|
+
element: "_element_1jseb_30",
|
|
7823
|
+
extra: "_extra_1jseb_41",
|
|
7824
|
+
child: "_child_1jseb_31"
|
|
7823
7825
|
};
|
|
7824
7826
|
//#endregion
|
|
7825
7827
|
//#region src/question/preview/QuestionCompositePreview.tsx
|
|
@@ -7830,11 +7832,12 @@ function hu({ messages: e, numberPath: t = [], renderChild: n, value: r }) {
|
|
|
7830
7832
|
}) : /* @__PURE__ */ a("div", {
|
|
7831
7833
|
className: mu.children,
|
|
7832
7834
|
children: r.children.map((e, i) => {
|
|
7833
|
-
let o = [...t, i];
|
|
7835
|
+
let o = [...t, i], s = Lo(o, r.children.length) ? Io(o) : null;
|
|
7834
7836
|
return /* @__PURE__ */ a("section", {
|
|
7835
7837
|
className: mu.child,
|
|
7836
7838
|
children: /* @__PURE__ */ a(zo, {
|
|
7837
|
-
|
|
7839
|
+
indented: !0,
|
|
7840
|
+
number: s,
|
|
7838
7841
|
children: n(e, o)
|
|
7839
7842
|
})
|
|
7840
7843
|
}, e.id || i);
|
|
@@ -7861,7 +7864,7 @@ function vu({ className: e, messages: t, numberPath: n, showAnswer: r = !1, show
|
|
|
7861
7864
|
children: t.missingQuestionTypeTemplate
|
|
7862
7865
|
})
|
|
7863
7866
|
});
|
|
7864
|
-
let d = /* @__PURE__ */ a("div", {
|
|
7867
|
+
let d = u.elements.length === 0 ? null : /* @__PURE__ */ a("div", {
|
|
7865
7868
|
className: mu["element-list"],
|
|
7866
7869
|
children: u.elements.map((e, n) => {
|
|
7867
7870
|
let i = rn(l, n, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionPlayerComposite.d.ts","sourceRoot":"","sources":["../../../src/question/player/QuestionPlayerComposite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EACV,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AASxE,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,qBAAqB,EAAE,CACrB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,0BAA0B,KACjC,IAAI,CAAC;IACV,WAAW,EAAE,CACX,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,0BA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AAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,UAAe,EACf,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,KAAK,GACN,EAAE,QAAQ,CAAC,4BAA4B,CAAC,GAAG,YAAY,CAsCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionCompositePreview.d.ts","sourceRoot":"","sources":["../../../src/question/preview/QuestionCompositePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EACV,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,CACX,KAAK,EAAE,oBAAoB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,KAC1B,YAAY,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,oBAAoB,CAAC;CAC7B,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,UAAe,EACf,WAAW,EACX,KAAK,GACN,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"QuestionCompositePreview.d.ts","sourceRoot":"","sources":["../../../src/question/preview/QuestionCompositePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EACV,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,CACX,KAAK,EAAE,oBAAoB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,KAC1B,YAAY,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,oBAAoB,CAAC;CAC7B,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,UAAe,EACf,WAAW,EACX,KAAK,GACN,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAAG,YAAY,CAyBxD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
export type SubquestionNumberedContentProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
indented?: boolean;
|
|
4
5
|
number: string | null;
|
|
5
6
|
};
|
|
6
|
-
export declare function SubquestionNumberedContent({ children, number, }: Readonly<SubquestionNumberedContentProps>): ReactElement;
|
|
7
|
+
export declare function SubquestionNumberedContent({ children, indented, number, }: Readonly<SubquestionNumberedContentProps>): ReactElement;
|
|
7
8
|
//# sourceMappingURL=SubquestionNumberedContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubquestionNumberedContent.d.ts","sourceRoot":"","sources":["../../../src/question/shared/SubquestionNumberedContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,MAAM,GACP,EAAE,QAAQ,CAAC,+BAA+B,CAAC,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"SubquestionNumberedContent.d.ts","sourceRoot":"","sources":["../../../src/question/shared/SubquestionNumberedContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,QAAgB,EAChB,MAAM,GACP,EAAE,QAAQ,CAAC,+BAA+B,CAAC,GAAG,YAAY,CAgB1D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yungu-fed/question-editor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -21,19 +21,6 @@
|
|
|
21
21
|
"dist",
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "pnpm run typecheck && vite build && tsc -p tsconfig.types.json",
|
|
26
|
-
"build:watch": "vite build --watch",
|
|
27
|
-
"build-ladle": "ladle build --viteConfig ./ladle.vite.config.ts",
|
|
28
|
-
"check": "pnpm run checkstyle && pnpm run lint && pnpm run test && pnpm run build && pnpm run build-ladle",
|
|
29
|
-
"checkstyle": "stylelint \"src/**/*.css\" --allow-empty-input",
|
|
30
|
-
"ladle": "ladle serve --viteConfig ./ladle.vite.config.ts",
|
|
31
|
-
"lint": "eslint .",
|
|
32
|
-
"test": "vitest run --passWithNoTests",
|
|
33
|
-
"test:coverage": "vitest run --coverage",
|
|
34
|
-
"test:watch": "vitest",
|
|
35
|
-
"typecheck": "tsc -b"
|
|
36
|
-
},
|
|
37
24
|
"peerDependencies": {
|
|
38
25
|
"@types/react": ">=16.14.0 <20",
|
|
39
26
|
"react": ">=16.14.0 <20",
|
|
@@ -84,5 +71,18 @@
|
|
|
84
71
|
"dependencies": {
|
|
85
72
|
"@yungu-fed/rich-text-editor": "^0.1.5",
|
|
86
73
|
"ulid": "^3.0.2"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "pnpm run typecheck && vite build && tsc -p tsconfig.types.json",
|
|
77
|
+
"build:watch": "vite build --watch",
|
|
78
|
+
"build-ladle": "ladle build --viteConfig ./ladle.vite.config.ts",
|
|
79
|
+
"check": "pnpm run checkstyle && pnpm run lint && pnpm run test && pnpm run build && pnpm run build-ladle",
|
|
80
|
+
"checkstyle": "stylelint \"src/**/*.css\" --allow-empty-input",
|
|
81
|
+
"ladle": "ladle serve --viteConfig ./ladle.vite.config.ts",
|
|
82
|
+
"lint": "eslint .",
|
|
83
|
+
"test": "vitest run --passWithNoTests",
|
|
84
|
+
"test:coverage": "vitest run --coverage",
|
|
85
|
+
"test:watch": "vitest",
|
|
86
|
+
"typecheck": "tsc -b"
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
}
|