@ixo/editor 1.8.0 → 1.8.1
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.
|
@@ -7050,7 +7050,8 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
7050
7050
|
|
|
7051
7051
|
// src/mantine/blocks/proposal/ProposalBlock.tsx
|
|
7052
7052
|
function ProposalBlock({ editor, block }) {
|
|
7053
|
-
|
|
7053
|
+
const { docType } = useBlocknoteContext();
|
|
7054
|
+
if (docType === "template") {
|
|
7054
7055
|
return /* @__PURE__ */ React81.createElement(ProposalTemplateView, { editor, block });
|
|
7055
7056
|
}
|
|
7056
7057
|
return /* @__PURE__ */ React81.createElement(ProposalFlowView, { block, editor });
|
|
@@ -8626,7 +8627,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8626
8627
|
tableHandles = true,
|
|
8627
8628
|
user,
|
|
8628
8629
|
matrixClient,
|
|
8629
|
-
permissions = {
|
|
8630
|
+
permissions = { write: false }
|
|
8630
8631
|
} = options || {};
|
|
8631
8632
|
const memoizedUser = useMemo16(
|
|
8632
8633
|
() => ({
|
|
@@ -8720,6 +8721,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8720
8721
|
return userFragment.get(block.id) || {};
|
|
8721
8722
|
};
|
|
8722
8723
|
ixoEditor.updateUserProps = (block, updates) => {
|
|
8724
|
+
if (!permissions.write) {
|
|
8725
|
+
console.warn("Cannot update user props: write permission denied");
|
|
8726
|
+
return;
|
|
8727
|
+
}
|
|
8723
8728
|
const prev = userFragment.get(block.id) || {};
|
|
8724
8729
|
userFragment.set(block.id, { ...prev, ...updates });
|
|
8725
8730
|
};
|
|
@@ -8735,6 +8740,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8735
8740
|
};
|
|
8736
8741
|
};
|
|
8737
8742
|
ixoEditor.updateFlowMetadata = (updates) => {
|
|
8743
|
+
if (!permissions.write) {
|
|
8744
|
+
console.warn("Cannot update flow metadata: write permission denied");
|
|
8745
|
+
return;
|
|
8746
|
+
}
|
|
8738
8747
|
Object.entries(updates).forEach(([key, value]) => {
|
|
8739
8748
|
if (key === "title") {
|
|
8740
8749
|
titleText.delete(0, titleText.length);
|
|
@@ -8749,6 +8758,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8749
8758
|
};
|
|
8750
8759
|
ixoEditor.getDocType = () => root.get("docType") || "";
|
|
8751
8760
|
ixoEditor.setDocType = (value) => {
|
|
8761
|
+
if (!permissions.write) {
|
|
8762
|
+
console.warn("Cannot set doc type: write permission denied");
|
|
8763
|
+
return;
|
|
8764
|
+
}
|
|
8752
8765
|
root.set("docType", value);
|
|
8753
8766
|
};
|
|
8754
8767
|
}
|
|
@@ -8994,4 +9007,4 @@ export {
|
|
|
8994
9007
|
ixoGraphQLClient,
|
|
8995
9008
|
getEntity
|
|
8996
9009
|
};
|
|
8997
|
-
//# sourceMappingURL=chunk-
|
|
9010
|
+
//# sourceMappingURL=chunk-ASAGPCCF.mjs.map
|