@open-mercato/documents 0.10.1-develop.7786.1.g3645046322 → 0.10.1-develop.7792.1.b0ce6289cf
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.
|
@@ -25,7 +25,7 @@ function DocumentEditorIsland(props) {
|
|
|
25
25
|
const query = next.toString();
|
|
26
26
|
router.replace(query ? `?${query}` : "?", { scroll: false });
|
|
27
27
|
}, [forcedReadOnly, router, searchParams]);
|
|
28
|
-
if (collaboration.mode === "connecting") return /* @__PURE__ */ jsx(LoadingMessage, { label: t("documents.editor.loading") });
|
|
28
|
+
if (collaboration.mode === "connecting" || collaboration.mode === "collab" && collaboration.connectionStatus === "connecting") return /* @__PURE__ */ jsx(LoadingMessage, { label: t("documents.editor.loading") });
|
|
29
29
|
if (collaboration.mode === "fallback") {
|
|
30
30
|
return /* @__PURE__ */ createElement(DocumentEditorSurface, { ...props, readOnly: forcedReadOnly, key: `fallback:${props.documentId}`, transport: "fallback", connectionStatus: "offline", presenceUsers: [], mode, onModeChange: changeMode });
|
|
31
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/documents/backend/documents/%5Bid%5D/DocumentEditorIsland.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { LoadingMessage } from '@open-mercato/ui/backend/detail'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { DocumentEditorSurface } from './DocumentEditorSurface'\nimport { resolveEditorMode, type DocumentEditorIslandProps, type EditorMode } from './editorTypes'\nimport { useDocumentCollaboration } from './useDocumentCollaboration'\n\nexport default function DocumentEditorIsland(props: DocumentEditorIslandProps) {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n const collaboration = useDocumentCollaboration(props.documentId)\n const requestedMode: EditorMode = searchParams.get('mode') === 'preview' ? 'preview' : 'edit'\n const serverReadOnly = collaboration.mode === 'collab'\n ? collaboration.serverReadOnly\n : collaboration.mode === 'fallback'\n ? collaboration.readOnly\n : false\n const forcedReadOnly = props.readOnly || serverReadOnly\n const mode = resolveEditorMode(props.readOnly, serverReadOnly, requestedMode)\n const changeMode = React.useCallback((nextMode: EditorMode) => {\n if (forcedReadOnly) return\n const next = new URLSearchParams(searchParams.toString())\n if (nextMode === 'preview') next.set('mode', 'preview')\n else next.delete('mode')\n const query = next.toString()\n router.replace(query ? `?${query}` : '?', { scroll: false })\n }, [forcedReadOnly, router, searchParams])\n\n if (collaboration.mode === 'connecting') return <LoadingMessage label={t('documents.editor.loading')} />\n if (collaboration.mode === 'fallback') {\n return <DocumentEditorSurface {...props} readOnly={forcedReadOnly} key={`fallback:${props.documentId}`} transport=\"fallback\" connectionStatus=\"offline\" presenceUsers={[]} mode={mode} onModeChange={changeMode} />\n }\n return (\n <DocumentEditorSurface\n {...props}\n readOnly={forcedReadOnly}\n key={`collab:${props.documentId}`}\n transport=\"collab\"\n collabResources={collaboration.resources}\n connectionStatus={collaboration.connectionStatus}\n presenceUsers={collaboration.presenceUsers}\n mode={mode}\n onModeChange={changeMode}\n />\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { LoadingMessage } from '@open-mercato/ui/backend/detail'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { DocumentEditorSurface } from './DocumentEditorSurface'\nimport { resolveEditorMode, type DocumentEditorIslandProps, type EditorMode } from './editorTypes'\nimport { useDocumentCollaboration } from './useDocumentCollaboration'\n\nexport default function DocumentEditorIsland(props: DocumentEditorIslandProps) {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n const collaboration = useDocumentCollaboration(props.documentId)\n const requestedMode: EditorMode = searchParams.get('mode') === 'preview' ? 'preview' : 'edit'\n const serverReadOnly = collaboration.mode === 'collab'\n ? collaboration.serverReadOnly\n : collaboration.mode === 'fallback'\n ? collaboration.readOnly\n : false\n const forcedReadOnly = props.readOnly || serverReadOnly\n const mode = resolveEditorMode(props.readOnly, serverReadOnly, requestedMode)\n const changeMode = React.useCallback((nextMode: EditorMode) => {\n if (forcedReadOnly) return\n const next = new URLSearchParams(searchParams.toString())\n if (nextMode === 'preview') next.set('mode', 'preview')\n else next.delete('mode')\n const query = next.toString()\n router.replace(query ? `?${query}` : '?', { scroll: false })\n }, [forcedReadOnly, router, searchParams])\n\n if (\n collaboration.mode === 'connecting'\n || (collaboration.mode === 'collab' && collaboration.connectionStatus === 'connecting')\n ) return <LoadingMessage label={t('documents.editor.loading')} />\n if (collaboration.mode === 'fallback') {\n return <DocumentEditorSurface {...props} readOnly={forcedReadOnly} key={`fallback:${props.documentId}`} transport=\"fallback\" connectionStatus=\"offline\" presenceUsers={[]} mode={mode} onModeChange={changeMode} />\n }\n return (\n <DocumentEditorSurface\n {...props}\n readOnly={forcedReadOnly}\n key={`collab:${props.documentId}`}\n transport=\"collab\"\n collabResources={collaboration.resources}\n connectionStatus={collaboration.connectionStatus}\n presenceUsers={collaboration.presenceUsers}\n mode={mode}\n onModeChange={changeMode}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAmCW;AAEA;AAnCX,YAAY,WAAW;AACvB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,yBAA0E;AACnF,SAAS,gCAAgC;AAE1B,SAAR,qBAAsC,OAAkC;AAC7E,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,eAAe,gBAAgB;AACrC,QAAM,gBAAgB,yBAAyB,MAAM,UAAU;AAC/D,QAAM,gBAA4B,aAAa,IAAI,MAAM,MAAM,YAAY,YAAY;AACvF,QAAM,iBAAiB,cAAc,SAAS,WAC1C,cAAc,iBACd,cAAc,SAAS,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|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -75,37 +75,37 @@
|
|
|
75
75
|
"@hocuspocus/server": "^4.4.0",
|
|
76
76
|
"@hocuspocus/transformer": "^4.3.0",
|
|
77
77
|
"@mikro-orm/core": "^7.1.14",
|
|
78
|
-
"@open-mercato/events": "0.10.1-develop.
|
|
79
|
-
"@open-mercato/ui": "0.10.1-develop.
|
|
80
|
-
"@tiptap/core": "^3",
|
|
81
|
-
"@tiptap/extension-bubble-menu": "^3",
|
|
82
|
-
"@tiptap/extension-collaboration": "^3.
|
|
83
|
-
"@tiptap/extension-collaboration-caret": "^3.
|
|
84
|
-
"@tiptap/extension-highlight": "^3",
|
|
85
|
-
"@tiptap/extension-image": "^3",
|
|
86
|
-
"@tiptap/extension-link": "^3",
|
|
87
|
-
"@tiptap/extension-list": "^3.
|
|
88
|
-
"@tiptap/extension-placeholder": "^3",
|
|
89
|
-
"@tiptap/extension-table": "^3",
|
|
90
|
-
"@tiptap/extension-table-cell": "^3",
|
|
91
|
-
"@tiptap/extension-table-header": "^3",
|
|
92
|
-
"@tiptap/extension-table-row": "^3",
|
|
93
|
-
"@tiptap/extension-task-item": "^3",
|
|
94
|
-
"@tiptap/extension-task-list": "^3",
|
|
95
|
-
"@tiptap/extension-text-align": "^3",
|
|
96
|
-
"@tiptap/extension-text-style": "^3",
|
|
97
|
-
"@tiptap/extensions": "^3",
|
|
98
|
-
"@tiptap/html": "^3.
|
|
99
|
-
"@tiptap/pm": "^3",
|
|
100
|
-
"@tiptap/react": "^3",
|
|
101
|
-
"@tiptap/starter-kit": "^3",
|
|
102
|
-
"@tiptap/suggestion": "^3",
|
|
103
|
-
"@tiptap/y-tiptap": "^3.0.
|
|
104
|
-
"happy-dom": "^
|
|
78
|
+
"@open-mercato/events": "0.10.1-develop.7792.1.b0ce6289cf",
|
|
79
|
+
"@open-mercato/ui": "0.10.1-develop.7792.1.b0ce6289cf",
|
|
80
|
+
"@tiptap/core": "^3.32.2",
|
|
81
|
+
"@tiptap/extension-bubble-menu": "^3.32.2",
|
|
82
|
+
"@tiptap/extension-collaboration": "^3.32.2",
|
|
83
|
+
"@tiptap/extension-collaboration-caret": "^3.32.2",
|
|
84
|
+
"@tiptap/extension-highlight": "^3.32.2",
|
|
85
|
+
"@tiptap/extension-image": "^3.32.2",
|
|
86
|
+
"@tiptap/extension-link": "^3.32.2",
|
|
87
|
+
"@tiptap/extension-list": "^3.32.2",
|
|
88
|
+
"@tiptap/extension-placeholder": "^3.32.2",
|
|
89
|
+
"@tiptap/extension-table": "^3.32.2",
|
|
90
|
+
"@tiptap/extension-table-cell": "^3.32.2",
|
|
91
|
+
"@tiptap/extension-table-header": "^3.32.2",
|
|
92
|
+
"@tiptap/extension-table-row": "^3.32.2",
|
|
93
|
+
"@tiptap/extension-task-item": "^3.32.2",
|
|
94
|
+
"@tiptap/extension-task-list": "^3.32.2",
|
|
95
|
+
"@tiptap/extension-text-align": "^3.32.2",
|
|
96
|
+
"@tiptap/extension-text-style": "^3.32.2",
|
|
97
|
+
"@tiptap/extensions": "^3.32.2",
|
|
98
|
+
"@tiptap/html": "^3.32.2",
|
|
99
|
+
"@tiptap/pm": "^3.32.2",
|
|
100
|
+
"@tiptap/react": "^3.32.2",
|
|
101
|
+
"@tiptap/starter-kit": "^3.32.2",
|
|
102
|
+
"@tiptap/suggestion": "^3.32.2",
|
|
103
|
+
"@tiptap/y-tiptap": "^3.0.7",
|
|
104
|
+
"happy-dom": "^21.0.4",
|
|
105
105
|
"jszip": "^3.10.1",
|
|
106
|
-
"prosemirror-model": "^1.25.
|
|
106
|
+
"prosemirror-model": "^1.25.12",
|
|
107
107
|
"prosemirror-state": "^1.4.4",
|
|
108
|
-
"prosemirror-view": "^1.42.
|
|
108
|
+
"prosemirror-view": "^1.42.6",
|
|
109
109
|
"puppeteer-core": "^25.3.0",
|
|
110
110
|
"y-prosemirror": "^1.3.7",
|
|
111
111
|
"y-protocols": "^1.0.7",
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
},
|
|
114
114
|
"peerDependencies": {
|
|
115
115
|
"@mikro-orm/postgresql": "^7.0.14",
|
|
116
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
116
|
+
"@open-mercato/shared": "0.10.1-develop.7792.1.b0ce6289cf",
|
|
117
117
|
"react": "^19.0.0",
|
|
118
118
|
"react-dom": "^19.0.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@open-mercato/core": "0.10.1-develop.
|
|
122
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
121
|
+
"@open-mercato/core": "0.10.1-develop.7792.1.b0ce6289cf",
|
|
122
|
+
"@open-mercato/shared": "0.10.1-develop.7792.1.b0ce6289cf",
|
|
123
123
|
"@types/jest": "^30.0.0",
|
|
124
124
|
"@types/pg": "^8.23.1",
|
|
125
125
|
"@types/react": "^19.2.18",
|
|
@@ -30,7 +30,10 @@ export default function DocumentEditorIsland(props: DocumentEditorIslandProps) {
|
|
|
30
30
|
router.replace(query ? `?${query}` : '?', { scroll: false })
|
|
31
31
|
}, [forcedReadOnly, router, searchParams])
|
|
32
32
|
|
|
33
|
-
if (
|
|
33
|
+
if (
|
|
34
|
+
collaboration.mode === 'connecting'
|
|
35
|
+
|| (collaboration.mode === 'collab' && collaboration.connectionStatus === 'connecting')
|
|
36
|
+
) return <LoadingMessage label={t('documents.editor.loading')} />
|
|
34
37
|
if (collaboration.mode === 'fallback') {
|
|
35
38
|
return <DocumentEditorSurface {...props} readOnly={forcedReadOnly} key={`fallback:${props.documentId}`} transport="fallback" connectionStatus="offline" presenceUsers={[]} mode={mode} onModeChange={changeMode} />
|
|
36
39
|
}
|