@edifice.io/react 2.6.10-develop-pedago.20261022145938 → 2.6.10-develop-pedago.20261023145636
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/modules/modals/ResourceModal/ResourceModal.js +16 -9
- package/dist/modules/modals/ResourceModal/apps/BlogPublic.js +9 -13
- package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{prosemirror-transform@1.12.3 → prosemirror-transform@1.12.4}/node_modules/prosemirror-transform/dist/index.js +10 -10
- package/package.json +6 -6
|
@@ -51,12 +51,19 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
51
51
|
} = useForm({
|
|
52
52
|
mode: "onChange",
|
|
53
53
|
defaultValues: {
|
|
54
|
-
description:
|
|
55
|
-
enablePublic:
|
|
56
|
-
title:
|
|
57
|
-
formSlug:
|
|
58
|
-
allowReplies:
|
|
59
|
-
}
|
|
54
|
+
description: "",
|
|
55
|
+
enablePublic: !1,
|
|
56
|
+
title: "",
|
|
57
|
+
formSlug: "",
|
|
58
|
+
allowReplies: !0
|
|
59
|
+
},
|
|
60
|
+
values: isUpdating && resource ? {
|
|
61
|
+
description: resource.description ?? "",
|
|
62
|
+
enablePublic: resource.public ?? !1,
|
|
63
|
+
title: resource.name ?? "",
|
|
64
|
+
formSlug: resource.slug ?? "",
|
|
65
|
+
allowReplies: resource.allowReplies ?? !0
|
|
66
|
+
} : void 0
|
|
60
67
|
}), {
|
|
61
68
|
ref: mediaLibraryRef,
|
|
62
69
|
libraryMedia,
|
|
@@ -143,9 +150,9 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
143
150
|
maxLength: textareaMaxLength
|
|
144
151
|
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength, showCounter: !0 })
|
|
145
152
|
] }),
|
|
146
|
-
application === "blog" && hasOptionalCommentRepliesWorkflow === !0 && /* @__PURE__ */ jsxs(
|
|
147
|
-
/* @__PURE__ */ jsx(
|
|
148
|
-
/* @__PURE__ */ jsx(
|
|
153
|
+
application === "blog" && hasOptionalCommentRepliesWorkflow === !0 && /* @__PURE__ */ jsxs("div", { className: "form-check d-flex align-items-center gap-8 mt-16 mb-8", children: [
|
|
154
|
+
/* @__PURE__ */ jsx("input", { id: "allowReplies", type: "checkbox", className: "form-check-input mt-0", defaultChecked: isUpdating ? resource.allowReplies : !0, ...register("allowReplies") }),
|
|
155
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "allowReplies", className: "form-check-label mb-0", children: t("explorer.resource.editModal.comments.allowReplies") })
|
|
149
156
|
] })
|
|
150
157
|
] })
|
|
151
158
|
] }),
|
|
@@ -4,8 +4,7 @@ import SvgIconCopy from "../../../icons/components/IconCopy.js";
|
|
|
4
4
|
import { useSlug } from "../hooks/useSlug.js";
|
|
5
5
|
import Heading from "../../../../components/Heading/Heading.js";
|
|
6
6
|
import Alert from "../../../../components/Alert/Alert.js";
|
|
7
|
-
import
|
|
8
|
-
import Input from "../../../../components/Input/Input.js";
|
|
7
|
+
import Switch from "../../../../components/Switch/Switch.js";
|
|
9
8
|
import Button from "../../../../components/Button/Button.js";
|
|
10
9
|
const BlogPublic = ({
|
|
11
10
|
appCode,
|
|
@@ -34,18 +33,15 @@ const BlogPublic = ({
|
|
|
34
33
|
appCode
|
|
35
34
|
] }),
|
|
36
35
|
/* @__PURE__ */ jsx(Alert, { type: "info", children: t("explorer.resource.editModal.access.alert") }),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}), className: "form-check-input mt-0", size: "md" }),
|
|
45
|
-
/* @__PURE__ */ jsx(FormControl.Label, { className: "form-check-label mb-0", children: t("explorer.resource.editModal.access.flexSwitchCheckDefault.label") })
|
|
46
|
-
] }),
|
|
36
|
+
/* @__PURE__ */ jsx(Switch, { id: "flexSwitchCheckDefault", role: "switch", className: "mt-16 mb-8", label: t("explorer.resource.editModal.access.flexSwitchCheckDefault.label"), defaultChecked: isUpdating ? resource.public : !1, ...register("enablePublic", {
|
|
37
|
+
disabled: !resourceName,
|
|
38
|
+
onChange: (event) => {
|
|
39
|
+
const checked = event.target.checked;
|
|
40
|
+
onPublicChange(checked);
|
|
41
|
+
}
|
|
42
|
+
}) }),
|
|
47
43
|
isPublic && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
44
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", defaultValue: isUpdating ? slug : "", ...register("formSlug") }, slug),
|
|
49
45
|
/* @__PURE__ */ jsxs("div", { className: "d-flex flex-wrap align-items-center gap-4", children: [
|
|
50
46
|
/* @__PURE__ */ jsxs("p", { className: "text-break", children: [
|
|
51
47
|
window.location.origin,
|
package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Slice, Fragment } from "../../../../prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js";
|
|
2
|
-
import { ReplaceStep, ReplaceAroundStep } from "../../../../prosemirror-transform@1.12.
|
|
2
|
+
import { ReplaceStep, ReplaceAroundStep } from "../../../../prosemirror-transform@1.12.4/node_modules/prosemirror-transform/dist/index.js";
|
|
3
3
|
const classesById = /* @__PURE__ */ Object.create(null);
|
|
4
4
|
class Selection {
|
|
5
5
|
/**
|
|
@@ -235,8 +235,6 @@ class AddMarkStep extends Step {
|
|
|
235
235
|
super(), this.from = from, this.to = to, this.mark = mark;
|
|
236
236
|
}
|
|
237
237
|
apply(doc) {
|
|
238
|
-
if (this.from == this.to)
|
|
239
|
-
return new StepResult(doc, null);
|
|
240
238
|
let oldSlice = doc.slice(this.from, this.to), $from = doc.resolve(this.from), parent = $from.node($from.sharedDepth(this.to)), slice = new Slice(mapFragment(oldSlice.content, (node, parent2) => !node.isAtom || !parent2.type.allowsMarkType(this.mark.type) ? node : node.mark(this.mark.addToSet(node.marks)), parent), oldSlice.openStart, oldSlice.openEnd);
|
|
241
239
|
return StepResult.fromReplace(doc, this.from, this.to, slice);
|
|
242
240
|
}
|
|
@@ -247,12 +245,12 @@ class AddMarkStep extends Step {
|
|
|
247
245
|
let added = this.mark.addToSet(node.marks);
|
|
248
246
|
if (!Mark.sameSet(added, node.marks)) {
|
|
249
247
|
let from = Math.max(this.from, pos), to = Math.min(this.to, pos + node.nodeSize);
|
|
250
|
-
|
|
248
|
+
pushMarkStep(RemoveMarkStep, from, to, this.mark, steps);
|
|
251
249
|
for (let mark of node.marks)
|
|
252
|
-
mark.isInSet(added) ||
|
|
250
|
+
mark.isInSet(added) || pushMarkStep(AddMarkStep, from, to, mark, steps);
|
|
253
251
|
}
|
|
254
252
|
}
|
|
255
|
-
}), steps.length ==
|
|
253
|
+
}), steps.length == 1 ? steps[0] : new MarkSetStep(steps);
|
|
256
254
|
}
|
|
257
255
|
map(mapping) {
|
|
258
256
|
let from = mapping.map(this.from, 1), to = mapping.map(this.to, -1);
|
|
@@ -287,16 +285,14 @@ class RemoveMarkStep extends Step {
|
|
|
287
285
|
super(), this.from = from, this.to = to, this.mark = mark;
|
|
288
286
|
}
|
|
289
287
|
apply(doc) {
|
|
290
|
-
if (this.from == this.to)
|
|
291
|
-
return new StepResult(doc, null);
|
|
292
288
|
let oldSlice = doc.slice(this.from, this.to), slice = new Slice(mapFragment(oldSlice.content, (node) => node.mark(this.mark.removeFromSet(node.marks)), doc), oldSlice.openStart, oldSlice.openEnd);
|
|
293
289
|
return StepResult.fromReplace(doc, this.from, this.to, slice);
|
|
294
290
|
}
|
|
295
291
|
invert(doc) {
|
|
296
292
|
let steps = [];
|
|
297
293
|
return doc.nodesBetween(this.from, this.to, (node, pos) => {
|
|
298
|
-
node.isInline && node.isAtom && this.mark.isInSet(node.marks) &&
|
|
299
|
-
}), steps.length ==
|
|
294
|
+
node.isInline && node.isAtom && this.mark.isInSet(node.marks) && pushMarkStep(AddMarkStep, Math.max(this.from, pos), Math.min(this.to, pos + node.nodeSize), this.mark, steps);
|
|
295
|
+
}), steps.length == 1 ? steps[0] : new MarkSetStep(steps);
|
|
300
296
|
}
|
|
301
297
|
map(mapping) {
|
|
302
298
|
let from = mapping.map(this.from, 1), to = mapping.map(this.to, -1);
|
|
@@ -323,6 +319,10 @@ class RemoveMarkStep extends Step {
|
|
|
323
319
|
}
|
|
324
320
|
}
|
|
325
321
|
Step.jsonID("removeMark", RemoveMarkStep);
|
|
322
|
+
function pushMarkStep(cls, from, to, mark, target) {
|
|
323
|
+
let last = target.length ? target[target.length - 1] : null;
|
|
324
|
+
last && last instanceof cls && last.to == from && last.mark.eq(mark) ? target[target.length - 1] = new cls(last.from, to, mark) : target.push(new cls(from, to, mark));
|
|
325
|
+
}
|
|
326
326
|
class MarkSetStep extends Step {
|
|
327
327
|
constructor(steps) {
|
|
328
328
|
super(), this.steps = steps;
|
|
@@ -350,7 +350,7 @@ class MarkSetStep extends Step {
|
|
|
350
350
|
toJSON() {
|
|
351
351
|
return { stepType: "markSet", steps: this.steps.map((s) => s.toJSON()) };
|
|
352
352
|
}
|
|
353
|
-
fromJSON(schema, json) {
|
|
353
|
+
static fromJSON(schema, json) {
|
|
354
354
|
if (!Array.isArray(json.steps) || !json.steps.every((s) => s.stepType == "addMark" || s.stepType == "removeMark"))
|
|
355
355
|
throw new RangeError("Invalid JSON for MarkSetStep");
|
|
356
356
|
return new MarkSetStep(json.steps.map((s) => Step.fromJSON(schema, s)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.10-develop-pedago.
|
|
3
|
+
"version": "2.6.10-develop-pedago.20261023145636",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
"swiper": "10.1.0",
|
|
133
133
|
"ua-parser-js": "1.0.36",
|
|
134
134
|
"zustand": "4.5.7",
|
|
135
|
-
"@edifice.io/
|
|
136
|
-
"@edifice.io/tiptap-extensions": "2.6.10-develop-pedago.
|
|
137
|
-
"@edifice.io/
|
|
135
|
+
"@edifice.io/bootstrap": "2.6.10-develop-pedago.20261023145636",
|
|
136
|
+
"@edifice.io/tiptap-extensions": "2.6.10-develop-pedago.20261023145636",
|
|
137
|
+
"@edifice.io/utilities": "2.6.10-develop-pedago.20261023145636"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
140
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -165,8 +165,8 @@
|
|
|
165
165
|
"vite": "5.4.14",
|
|
166
166
|
"vite-plugin-dts": "4.5.4",
|
|
167
167
|
"vite-tsconfig-paths": "5.1.4",
|
|
168
|
-
"@edifice.io/client": "2.6.10-develop-pedago.
|
|
169
|
-
"@edifice.io/config": "2.6.10-develop-pedago.
|
|
168
|
+
"@edifice.io/client": "2.6.10-develop-pedago.20261023145636",
|
|
169
|
+
"@edifice.io/config": "2.6.10-develop-pedago.20261023145636"
|
|
170
170
|
},
|
|
171
171
|
"peerDependencies": {
|
|
172
172
|
"@react-spring/web": "9.7.5",
|