@bgx4k3p/huly-mcp-server 2.2.3 → 2.2.5
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/README.md +186 -56
- package/node_modules/@hcengineering/account-client/lib/__tests__/utils.test.js +249 -0
- package/node_modules/@hcengineering/account-client/lib/__tests__/utils.test.js.map +7 -0
- package/node_modules/@hcengineering/account-client/lib/client.js +88 -3
- package/node_modules/@hcengineering/account-client/lib/client.js.map +2 -2
- package/node_modules/@hcengineering/account-client/lib/types.js.map +2 -2
- package/node_modules/@hcengineering/account-client/lib/utils.js +50 -0
- package/node_modules/@hcengineering/account-client/lib/utils.js.map +2 -2
- package/node_modules/@hcengineering/account-client/package.json +22 -19
- package/node_modules/@hcengineering/account-client/src/__tests__/utils.test.ts +304 -0
- package/node_modules/@hcengineering/account-client/src/client.ts +127 -6
- package/node_modules/@hcengineering/account-client/src/types.ts +7 -0
- package/node_modules/@hcengineering/account-client/src/utils.ts +65 -1
- package/node_modules/@hcengineering/analytics/lib/index.js +1 -1
- package/node_modules/@hcengineering/analytics/lib/index.js.map +2 -2
- package/node_modules/@hcengineering/analytics/package.json +19 -16
- package/node_modules/@hcengineering/analytics/src/index.ts +2 -1
- package/node_modules/@hcengineering/api-client/lib/client.js +9 -4
- package/node_modules/@hcengineering/api-client/lib/client.js.map +2 -2
- package/node_modules/@hcengineering/api-client/lib/rest/adapter.js +64 -0
- package/node_modules/@hcengineering/api-client/lib/rest/adapter.js.map +7 -0
- package/node_modules/@hcengineering/api-client/lib/rest/index.js +2 -0
- package/node_modules/@hcengineering/api-client/lib/rest/index.js.map +2 -2
- package/node_modules/@hcengineering/api-client/lib/socket/node.js +5 -1
- package/node_modules/@hcengineering/api-client/lib/socket/node.js.map +2 -2
- package/node_modules/@hcengineering/api-client/package.json +28 -25
- package/node_modules/@hcengineering/api-client/src/client.ts +10 -1
- package/node_modules/@hcengineering/api-client/src/rest/adapter.ts +96 -0
- package/node_modules/@hcengineering/api-client/src/rest/index.ts +1 -0
- package/node_modules/@hcengineering/api-client/src/socket/node.ts +6 -1
- package/node_modules/@hcengineering/chunter/lib/index.js.map +2 -2
- package/node_modules/@hcengineering/chunter/package.json +13 -10
- package/node_modules/@hcengineering/client/package.json +21 -18
- package/node_modules/@hcengineering/client-resources/package.json +24 -21
- package/node_modules/@hcengineering/collaborator-client/package.json +21 -18
- package/node_modules/@hcengineering/contact/lib/__tests__/workspaceMemberStatusUtils.test.js +38 -0
- package/node_modules/@hcengineering/contact/lib/__tests__/workspaceMemberStatusUtils.test.js.map +7 -0
- package/node_modules/@hcengineering/contact/lib/index.js +13 -4
- package/node_modules/@hcengineering/contact/lib/index.js.map +2 -2
- package/node_modules/@hcengineering/contact/lib/types.js.map +1 -1
- package/node_modules/@hcengineering/contact/lib/utils.js +132 -108
- package/node_modules/@hcengineering/contact/lib/utils.js.map +3 -3
- package/node_modules/@hcengineering/contact/lib/workspaceMemberStatusUtils.js +79 -0
- package/node_modules/@hcengineering/contact/lib/workspaceMemberStatusUtils.js.map +7 -0
- package/node_modules/@hcengineering/contact/package.json +12 -9
- package/node_modules/@hcengineering/core/CHANGELOG.md +9 -1
- package/node_modules/@hcengineering/core/lang/cs.json +6 -1
- package/node_modules/@hcengineering/core/lang/de.json +6 -1
- package/node_modules/@hcengineering/core/lang/en.json +6 -1
- package/node_modules/@hcengineering/core/lang/es.json +6 -1
- package/node_modules/@hcengineering/core/lang/fr.json +6 -1
- package/node_modules/@hcengineering/core/lang/it.json +6 -1
- package/node_modules/@hcengineering/core/lang/ja.json +6 -1
- package/node_modules/@hcengineering/core/lang/pt-br.json +70 -0
- package/node_modules/@hcengineering/core/lang/pt.json +6 -1
- package/node_modules/@hcengineering/core/lang/ru.json +6 -1
- package/node_modules/@hcengineering/core/lang/tr.json +6 -1
- package/node_modules/@hcengineering/core/lang/zh.json +6 -1
- package/node_modules/@hcengineering/core/lib/__tests__/autoJoinRoles.test.js +13 -0
- package/node_modules/@hcengineering/core/lib/__tests__/autoJoinRoles.test.js.map +7 -0
- package/node_modules/@hcengineering/core/lib/__tests__/memdb.test.js +133 -0
- package/node_modules/@hcengineering/core/lib/__tests__/memdb.test.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/__tests__/minmodel.js +25 -0
- package/node_modules/@hcengineering/core/lib/__tests__/minmodel.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/__tests__/query.test.js +43 -0
- package/node_modules/@hcengineering/core/lib/__tests__/query.test.js.map +7 -0
- package/node_modules/@hcengineering/core/lib/autoJoinRoles.js +36 -0
- package/node_modules/@hcengineering/core/lib/autoJoinRoles.js.map +7 -0
- package/node_modules/@hcengineering/core/lib/classes.js +5 -0
- package/node_modules/@hcengineering/core/lib/classes.js.map +3 -3
- package/node_modules/@hcengineering/core/lib/clone.js +13 -2
- package/node_modules/@hcengineering/core/lib/clone.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/component.js +14 -3
- package/node_modules/@hcengineering/core/lib/component.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/index.js +2 -0
- package/node_modules/@hcengineering/core/lib/index.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/memdb.js +6 -2
- package/node_modules/@hcengineering/core/lib/memdb.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/operations.js +11 -0
- package/node_modules/@hcengineering/core/lib/operations.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/predicate.js +3 -0
- package/node_modules/@hcengineering/core/lib/predicate.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/storage.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/tx.js +3 -1
- package/node_modules/@hcengineering/core/lib/tx.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/utils.js +1 -1
- package/node_modules/@hcengineering/core/lib/utils.js.map +2 -2
- package/node_modules/@hcengineering/core/lib/versioning.js +17 -0
- package/node_modules/@hcengineering/core/lib/versioning.js.map +7 -0
- package/node_modules/@hcengineering/core/package.json +22 -19
- package/node_modules/@hcengineering/core/src/__tests__/autoJoinRoles.test.ts +27 -0
- package/node_modules/@hcengineering/core/src/__tests__/memdb.test.ts +150 -1
- package/node_modules/@hcengineering/core/src/__tests__/minmodel.ts +29 -1
- package/node_modules/@hcengineering/core/src/__tests__/query.test.ts +66 -0
- package/node_modules/@hcengineering/core/src/autoJoinRoles.ts +33 -0
- package/node_modules/@hcengineering/core/src/classes.ts +61 -1
- package/node_modules/@hcengineering/core/src/clone.ts +13 -2
- package/node_modules/@hcengineering/core/src/component.ts +25 -9
- package/node_modules/@hcengineering/core/src/index.ts +2 -0
- package/node_modules/@hcengineering/core/src/memdb.ts +7 -3
- package/node_modules/@hcengineering/core/src/operations.ts +11 -0
- package/node_modules/@hcengineering/core/src/predicate.ts +3 -0
- package/node_modules/@hcengineering/core/src/storage.ts +6 -3
- package/node_modules/@hcengineering/core/src/tx.ts +4 -1
- package/node_modules/@hcengineering/core/src/utils.ts +1 -1
- package/node_modules/@hcengineering/core/src/versioning.ts +13 -0
- package/node_modules/@hcengineering/measurements/lib/__tests__/performance.test.js +3 -3
- package/node_modules/@hcengineering/measurements/lib/__tests__/performance.test.js.map +2 -2
- package/node_modules/@hcengineering/measurements/package.json +17 -14
- package/node_modules/@hcengineering/measurements/src/__tests__/performance.test.ts +3 -3
- package/node_modules/@hcengineering/platform/lang/pt-br.json +31 -0
- package/node_modules/@hcengineering/platform/lib/__tests__/i18n.test.js +100 -0
- package/node_modules/@hcengineering/platform/lib/__tests__/i18n.test.js.map +2 -2
- package/node_modules/@hcengineering/platform/lib/__tests__/status.test.js +78 -0
- package/node_modules/@hcengineering/platform/lib/__tests__/status.test.js.map +7 -0
- package/node_modules/@hcengineering/platform/lib/i18n.js +78 -69
- package/node_modules/@hcengineering/platform/lib/i18n.js.map +3 -3
- package/node_modules/@hcengineering/platform/lib/status.js +25 -0
- package/node_modules/@hcengineering/platform/lib/status.js.map +2 -2
- package/node_modules/@hcengineering/platform/package.json +18 -15
- package/node_modules/@hcengineering/platform/src/__tests__/i18n.test.ts +114 -2
- package/node_modules/@hcengineering/platform/src/__tests__/status.test.ts +77 -0
- package/node_modules/@hcengineering/platform/src/i18n.ts +99 -71
- package/node_modules/@hcengineering/platform/src/status.ts +30 -0
- package/node_modules/@hcengineering/rank/package.json +19 -16
- package/node_modules/@hcengineering/rpc/package.json +21 -18
- package/node_modules/@hcengineering/tags/package.json +12 -9
- package/node_modules/@hcengineering/task/package.json +14 -11
- package/node_modules/@hcengineering/text/lib/markup/__tests__/utils.test.js +25 -0
- package/node_modules/@hcengineering/text/lib/markup/__tests__/utils.test.js.map +2 -2
- package/node_modules/@hcengineering/text/lib/tiptapExtensions.js +6 -0
- package/node_modules/@hcengineering/text/lib/tiptapExtensions.js.map +2 -2
- package/node_modules/@hcengineering/text/package.json +23 -18
- package/node_modules/@hcengineering/text/src/markup/__tests__/utils.test.ts +27 -0
- package/node_modules/@hcengineering/text/src/tiptapExtensions.ts +3 -0
- package/node_modules/@hcengineering/text-core/lib/markup/model.js +1 -0
- package/node_modules/@hcengineering/text-core/lib/markup/model.js.map +2 -2
- package/node_modules/@hcengineering/text-core/package.json +20 -17
- package/node_modules/@hcengineering/text-core/src/markup/model.ts +2 -1
- package/node_modules/@hcengineering/text-html/package.json +19 -16
- package/node_modules/@hcengineering/text-markdown/lib/serializer.js +14 -0
- package/node_modules/@hcengineering/text-markdown/lib/serializer.js.map +2 -2
- package/node_modules/@hcengineering/text-markdown/package.json +20 -17
- package/node_modules/@hcengineering/text-markdown/src/serializer.ts +14 -0
- package/node_modules/@hcengineering/tracker/lib/index.js +1 -0
- package/node_modules/@hcengineering/tracker/lib/index.js.map +2 -2
- package/node_modules/@hcengineering/tracker/package.json +16 -13
- package/node_modules/@tiptap/core/dist/commands/focus.d.ts.map +1 -1
- package/node_modules/@tiptap/core/dist/index.cjs +19 -2
- package/node_modules/@tiptap/core/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/core/dist/index.js +19 -3
- package/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/node_modules/@tiptap/core/dist/index.umd.js +19 -2
- package/node_modules/@tiptap/core/dist/index.umd.js.map +1 -1
- package/node_modules/@tiptap/core/dist/utilities/index.d.ts +1 -0
- package/node_modules/@tiptap/core/dist/utilities/index.d.ts.map +1 -1
- package/node_modules/@tiptap/core/dist/utilities/isSafari.d.ts +10 -0
- package/node_modules/@tiptap/core/dist/utilities/isSafari.d.ts.map +1 -0
- package/node_modules/@tiptap/core/package.json +2 -2
- package/node_modules/@tiptap/core/src/commands/focus.ts +7 -2
- package/node_modules/@tiptap/core/src/utilities/index.ts +1 -0
- package/node_modules/@tiptap/core/src/utilities/isSafari.ts +11 -0
- package/node_modules/@tiptap/extension-blockquote/package.json +2 -2
- package/node_modules/@tiptap/extension-bold/package.json +2 -2
- package/node_modules/@tiptap/extension-bullet-list/package.json +2 -2
- package/node_modules/@tiptap/extension-code/package.json +2 -2
- package/node_modules/@tiptap/extension-code-block/package.json +3 -3
- package/node_modules/@tiptap/extension-document/package.json +2 -2
- package/node_modules/@tiptap/extension-dropcursor/package.json +3 -3
- package/node_modules/@tiptap/extension-gapcursor/package.json +3 -3
- package/node_modules/@tiptap/extension-hard-break/package.json +2 -2
- package/node_modules/@tiptap/extension-heading/package.json +2 -2
- package/node_modules/@tiptap/extension-highlight/package.json +2 -2
- package/node_modules/@tiptap/extension-history/package.json +3 -3
- package/node_modules/@tiptap/extension-horizontal-rule/package.json +3 -3
- package/node_modules/@tiptap/extension-italic/package.json +2 -2
- package/node_modules/@tiptap/extension-link/package.json +3 -3
- package/node_modules/@tiptap/extension-list-item/package.json +2 -2
- package/node_modules/@tiptap/extension-mention/package.json +4 -4
- package/node_modules/@tiptap/extension-ordered-list/package.json +2 -2
- package/node_modules/@tiptap/extension-paragraph/package.json +2 -2
- package/node_modules/@tiptap/extension-strike/package.json +2 -2
- package/node_modules/@tiptap/extension-subscript/README.md +14 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.cjs +61 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.ts +4 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.js +56 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.umd.js +65 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.umd.js.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/subscript.d.ts +36 -0
- package/node_modules/@tiptap/extension-subscript/dist/subscript.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-subscript/package.json +49 -0
- package/node_modules/@tiptap/extension-subscript/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-subscript/src/subscript.ts +91 -0
- package/node_modules/@tiptap/extension-superscript/README.md +14 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.cjs +61 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.ts +4 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.js +56 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.umd.js +65 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.umd.js.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/superscript.d.ts +36 -0
- package/node_modules/@tiptap/extension-superscript/dist/superscript.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-superscript/package.json +49 -0
- package/node_modules/@tiptap/extension-superscript/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-superscript/src/superscript.ts +91 -0
- package/node_modules/@tiptap/extension-table/package.json +3 -3
- package/node_modules/@tiptap/extension-table-cell/package.json +2 -2
- package/node_modules/@tiptap/extension-table-header/package.json +2 -2
- package/node_modules/@tiptap/extension-table-row/package.json +2 -2
- package/node_modules/@tiptap/extension-task-item/package.json +3 -3
- package/node_modules/@tiptap/extension-task-list/package.json +2 -2
- package/node_modules/@tiptap/extension-text/package.json +2 -2
- package/node_modules/@tiptap/extension-typography/package.json +2 -2
- package/node_modules/@tiptap/extension-underline/package.json +2 -2
- package/node_modules/@tiptap/html/package.json +3 -3
- package/node_modules/@tiptap/pm/package.json +1 -1
- package/node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-text-style/package.json +2 -2
- package/node_modules/@tiptap/starter-kit/package.json +22 -22
- package/node_modules/@tiptap/suggestion/package.json +3 -3
- package/node_modules/linkify-it/build/index.cjs.js +99 -94
- package/node_modules/linkify-it/index.mjs +99 -94
- package/node_modules/linkify-it/package.json +11 -1
- package/node_modules/linkifyjs/README.md +4 -2
- package/node_modules/linkifyjs/dist/linkify.cjs +8 -11
- package/node_modules/linkifyjs/dist/linkify.d.cts +14 -14
- package/node_modules/linkifyjs/dist/linkify.d.mts +14 -14
- package/node_modules/linkifyjs/dist/linkify.js +8 -11
- package/node_modules/linkifyjs/dist/linkify.min.js +1 -1
- package/node_modules/linkifyjs/dist/linkify.mjs +8 -11
- package/node_modules/linkifyjs/package.json +1 -1
- package/node_modules/markdown-it/README.md +13 -17
- package/node_modules/markdown-it/dist/index.cjs.js +111 -31
- package/node_modules/markdown-it/dist/markdown-it.js +117 -31
- package/node_modules/markdown-it/dist/markdown-it.min.js +2 -2
- package/node_modules/markdown-it/lib/common/utils.mjs +30 -1
- package/node_modules/markdown-it/lib/index.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +12 -1
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +4 -1
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +3 -1
- package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +37 -21
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +37 -6
- package/node_modules/markdown-it/package.json +14 -3
- package/node_modules/msgpackr/README.md +1 -3
- package/node_modules/msgpackr/benchmark.md +26 -16
- package/node_modules/msgpackr/dist/index-no-eval.cjs +35 -16
- package/node_modules/msgpackr/dist/index-no-eval.cjs.map +1 -1
- package/node_modules/msgpackr/dist/index-no-eval.min.js +1 -1
- package/node_modules/msgpackr/dist/index-no-eval.min.js.map +1 -1
- package/node_modules/msgpackr/dist/index.js +35 -16
- package/node_modules/msgpackr/dist/index.js.map +1 -1
- package/node_modules/msgpackr/dist/index.min.js +1 -1
- package/node_modules/msgpackr/dist/index.min.js.map +1 -1
- package/node_modules/msgpackr/dist/node.cjs +50 -26
- package/node_modules/msgpackr/dist/node.cjs.map +1 -1
- package/node_modules/msgpackr/dist/test.js +44 -16
- package/node_modules/msgpackr/dist/test.js.map +1 -1
- package/node_modules/msgpackr/dist/unpack-no-eval.cjs +35 -16
- package/node_modules/msgpackr/dist/unpack-no-eval.cjs.map +1 -1
- package/node_modules/msgpackr/index.d.cts +2 -0
- package/node_modules/msgpackr/index.d.ts +2 -0
- package/node_modules/msgpackr/package.json +1 -1
- package/node_modules/msgpackr/stream.js +15 -10
- package/node_modules/msgpackr/unpack.js +35 -16
- package/node_modules/prosemirror-changeset/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-changeset/README.md +31 -2
- package/node_modules/prosemirror-changeset/dist/index.cjs +17 -2
- package/node_modules/prosemirror-changeset/dist/index.d.cts +32 -2
- package/node_modules/prosemirror-changeset/dist/index.d.ts +32 -2
- package/node_modules/prosemirror-changeset/dist/index.js +18 -3
- package/node_modules/prosemirror-changeset/package.json +2 -2
- package/node_modules/prosemirror-changeset/src/README.md +4 -2
- package/node_modules/prosemirror-changeset/src/change.ts +18 -0
- package/node_modules/prosemirror-changeset/src/changeset.ts +10 -4
- package/node_modules/prosemirror-changeset/src/simplify.ts +1 -1
- package/node_modules/prosemirror-changeset/test/test-simplify.ts +3 -0
- package/node_modules/prosemirror-gapcursor/CHANGELOG.md +6 -0
- package/node_modules/prosemirror-gapcursor/dist/index.cjs +1 -1
- package/node_modules/prosemirror-gapcursor/dist/index.js +1 -1
- package/node_modules/prosemirror-gapcursor/package.json +3 -2
- package/node_modules/prosemirror-gapcursor/src/gapcursor.ts +1 -1
- package/node_modules/prosemirror-markdown/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-markdown/dist/index.cjs +11 -1
- package/node_modules/prosemirror-markdown/dist/index.js +14 -2
- package/node_modules/prosemirror-markdown/package.json +1 -1
- package/node_modules/prosemirror-markdown/src/to_markdown.ts +12 -3
- package/node_modules/prosemirror-menu/CHANGELOG.md +18 -0
- package/node_modules/prosemirror-menu/CONTRIBUTING.md +22 -18
- package/node_modules/prosemirror-menu/README.md +69 -29
- package/node_modules/prosemirror-menu/dist/index.cjs +232 -48
- package/node_modules/prosemirror-menu/dist/index.d.cts +29 -14
- package/node_modules/prosemirror-menu/dist/index.d.ts +29 -14
- package/node_modules/prosemirror-menu/dist/index.js +229 -36
- package/node_modules/prosemirror-menu/package.json +2 -2
- package/node_modules/prosemirror-menu/src/README.md +30 -1
- package/node_modules/prosemirror-menu/src/icons.ts +3 -2
- package/node_modules/prosemirror-menu/src/menu.ts +193 -40
- package/node_modules/prosemirror-menu/src/menubar.ts +50 -5
- package/node_modules/prosemirror-menu/style/menu.css +28 -7
- package/node_modules/prosemirror-model/CHANGELOG.md +20 -0
- package/node_modules/prosemirror-model/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-model/README.md +3 -3
- package/node_modules/prosemirror-model/dist/index.cjs +13 -10
- package/node_modules/prosemirror-model/dist/index.d.cts +25 -21
- package/node_modules/prosemirror-model/dist/index.d.ts +25 -21
- package/node_modules/prosemirror-model/dist/index.js +19 -23
- package/node_modules/prosemirror-model/package.json +2 -2
- package/node_modules/prosemirror-model/src/fragment.ts +1 -1
- package/node_modules/prosemirror-model/src/from_dom.ts +4 -1
- package/node_modules/prosemirror-model/src/node.ts +5 -4
- package/node_modules/prosemirror-model/src/replace.ts +6 -15
- package/node_modules/prosemirror-model/src/schema.ts +1 -1
- package/node_modules/prosemirror-model/src/to_dom.ts +24 -20
- package/node_modules/prosemirror-transform/CHANGELOG.md +16 -0
- package/node_modules/prosemirror-transform/dist/index.cjs +38 -4
- package/node_modules/prosemirror-transform/dist/index.d.cts +19 -0
- package/node_modules/prosemirror-transform/dist/index.d.ts +19 -0
- package/node_modules/prosemirror-transform/dist/index.js +52 -1
- package/node_modules/prosemirror-transform/package.json +1 -1
- package/node_modules/prosemirror-transform/src/replace.ts +16 -0
- package/node_modules/prosemirror-transform/src/replace_step.ts +10 -1
- package/node_modules/prosemirror-transform/src/transform.ts +21 -2
- package/node_modules/prosemirror-view/CHANGELOG.md +34 -2
- package/node_modules/prosemirror-view/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-view/README.md +3 -3
- package/node_modules/prosemirror-view/dist/index.cjs +96 -40
- package/node_modules/prosemirror-view/dist/index.d.cts +2 -2
- package/node_modules/prosemirror-view/dist/index.d.ts +2 -2
- package/node_modules/prosemirror-view/dist/index.js +90 -39
- package/node_modules/prosemirror-view/package.json +2 -2
- package/node_modules/prosemirror-view/src/domchange.ts +1 -1
- package/node_modules/prosemirror-view/src/domobserver.ts +59 -16
- package/node_modules/prosemirror-view/src/index.ts +4 -4
- package/node_modules/prosemirror-view/src/input.ts +9 -6
- package/node_modules/prosemirror-view/src/viewdesc.ts +26 -22
- package/node_modules/prosemirror-view/style/prosemirror.css +1 -1
- package/package.json +5 -4
- package/src/client.mjs +2 -2
- package/src/config.mjs +1 -0
- package/src/helpers.mjs +2 -2
- package/src/index.mjs +31 -1
- package/src/initCodex.mjs +281 -0
- package/src/mcp.mjs +11 -1
- package/src/mcpShared.mjs +95 -5
- package/node_modules/@hcengineering/account-client/types/client.d.ts +0 -140
- package/node_modules/@hcengineering/account-client/types/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/account-client/types/index.d.ts +0 -4
- package/node_modules/@hcengineering/account-client/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/account-client/types/types.d.ts +0 -177
- package/node_modules/@hcengineering/account-client/types/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/account-client/types/utils.d.ts +0 -5
- package/node_modules/@hcengineering/account-client/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/analytics/types/index.d.ts +0 -25
- package/node_modules/@hcengineering/analytics/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/__tests__/config.test.d.ts +0 -2
- package/node_modules/@hcengineering/api-client/types/__tests__/config.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/__tests__/markup-client.test.d.ts +0 -2
- package/node_modules/@hcengineering/api-client/types/__tests__/markup-client.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/__tests__/markup-types.test.d.ts +0 -2
- package/node_modules/@hcengineering/api-client/types/__tests__/markup-types.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/__tests__/rest-utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/api-client/types/__tests__/rest-utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/__tests__/utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/api-client/types/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/client.d.ts +0 -6
- package/node_modules/@hcengineering/api-client/types/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/config.d.ts +0 -8
- package/node_modules/@hcengineering/api-client/types/config.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/index.d.ts +0 -9
- package/node_modules/@hcengineering/api-client/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/markup/client.d.ts +0 -5
- package/node_modules/@hcengineering/api-client/types/markup/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/markup/index.d.ts +0 -3
- package/node_modules/@hcengineering/api-client/types/markup/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/markup/types.d.ts +0 -41
- package/node_modules/@hcengineering/api-client/types/markup/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/rest/index.d.ts +0 -4
- package/node_modules/@hcengineering/api-client/types/rest/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/rest/rest.d.ts +0 -39
- package/node_modules/@hcengineering/api-client/types/rest/rest.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/rest/tx.d.ts +0 -3
- package/node_modules/@hcengineering/api-client/types/rest/tx.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/rest/types.d.ts +0 -16
- package/node_modules/@hcengineering/api-client/types/rest/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/rest/utils.d.ts +0 -3
- package/node_modules/@hcengineering/api-client/types/rest/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/socket/browser.d.ts +0 -4
- package/node_modules/@hcengineering/api-client/types/socket/browser.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/socket/index.d.ts +0 -3
- package/node_modules/@hcengineering/api-client/types/socket/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/socket/node.d.ts +0 -4
- package/node_modules/@hcengineering/api-client/types/socket/node.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/storage/client.d.ts +0 -21
- package/node_modules/@hcengineering/api-client/types/storage/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/storage/error.d.ts +0 -10
- package/node_modules/@hcengineering/api-client/types/storage/error.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/storage/index.d.ts +0 -4
- package/node_modules/@hcengineering/api-client/types/storage/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/storage/types.d.ts +0 -10
- package/node_modules/@hcengineering/api-client/types/storage/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/types.d.ts +0 -101
- package/node_modules/@hcengineering/api-client/types/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/api-client/types/utils.d.ts +0 -12
- package/node_modules/@hcengineering/api-client/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/chunter/types/analytics.d.ts +0 -5
- package/node_modules/@hcengineering/chunter/types/analytics.d.ts.map +0 -1
- package/node_modules/@hcengineering/chunter/types/index.d.ts +0 -211
- package/node_modules/@hcengineering/chunter/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/chunter/types/utils.d.ts +0 -7
- package/node_modules/@hcengineering/chunter/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/client/types/__tests__/client.test.d.ts +0 -2
- package/node_modules/@hcengineering/client/types/__tests__/client.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/client/types/index.d.ts +0 -69
- package/node_modules/@hcengineering/client/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/client-resources/types/__tests__/connection.test.d.ts +0 -2
- package/node_modules/@hcengineering/client-resources/types/__tests__/connection.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/client-resources/types/__tests__/integration.test.d.ts +0 -45
- package/node_modules/@hcengineering/client-resources/types/__tests__/integration.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/client-resources/types/connection.d.ts +0 -7
- package/node_modules/@hcengineering/client-resources/types/connection.d.ts.map +0 -1
- package/node_modules/@hcengineering/client-resources/types/index.d.ts +0 -11
- package/node_modules/@hcengineering/client-resources/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/collaborator-client/types/__tests__/utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/collaborator-client/types/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/collaborator-client/types/client.d.ts +0 -34
- package/node_modules/@hcengineering/collaborator-client/types/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/collaborator-client/types/index.d.ts +0 -3
- package/node_modules/@hcengineering/collaborator-client/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/collaborator-client/types/utils.d.ts +0 -9
- package/node_modules/@hcengineering/collaborator-client/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/__tests__/cache.test.d.ts +0 -2
- package/node_modules/@hcengineering/contact/types/__tests__/cache.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/analytics.d.ts +0 -6
- package/node_modules/@hcengineering/contact/types/analytics.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/avatar.d.ts +0 -12
- package/node_modules/@hcengineering/contact/types/avatar.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/cache.d.ts +0 -49
- package/node_modules/@hcengineering/contact/types/cache.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/index.d.ts +0 -367
- package/node_modules/@hcengineering/contact/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/types.d.ts +0 -25
- package/node_modules/@hcengineering/contact/types/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/contact/types/utils.d.ts +0 -110
- package/node_modules/@hcengineering/contact/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/client.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/client.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/clone.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/clone.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/collaboration.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/collaboration.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/collaborators.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/collaborators.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/common.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/common.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/connection.d.ts +0 -4
- package/node_modules/@hcengineering/core/types/__tests__/connection.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/contexts.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/contexts.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/hierarchy.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/hierarchy.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/lang.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/lang.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/limiter-edge-cases.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/limiter-edge-cases.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/limits.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/limits.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/memdb.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/memdb.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/minmodel.d.ts +0 -50
- package/node_modules/@hcengineering/core/types/__tests__/minmodel.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/objvalue.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/objvalue.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/operator-bugs.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/operator-bugs.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/operator.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/operator.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/rate-limiter.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/rate-limiter.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/time.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/time.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/__tests__/utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/core/types/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/backup.d.ts +0 -26
- package/node_modules/@hcengineering/core/types/backup.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/benchmark.d.ts +0 -19
- package/node_modules/@hcengineering/core/types/benchmark.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/classes.d.ts +0 -716
- package/node_modules/@hcengineering/core/types/classes.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/client.d.ts +0 -69
- package/node_modules/@hcengineering/core/types/client.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/clone.d.ts +0 -3
- package/node_modules/@hcengineering/core/types/clone.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/collaboration.d.ts +0 -16
- package/node_modules/@hcengineering/core/types/collaboration.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/collaborators.d.ts +0 -3
- package/node_modules/@hcengineering/core/types/collaborators.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/common.d.ts +0 -4
- package/node_modules/@hcengineering/core/types/common.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/component.d.ts +0 -229
- package/node_modules/@hcengineering/core/types/component.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/hierarchy.d.ts +0 -84
- package/node_modules/@hcengineering/core/types/hierarchy.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/index.d.ts +0 -25
- package/node_modules/@hcengineering/core/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/memdb.d.ts +0 -60
- package/node_modules/@hcengineering/core/types/memdb.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/objvalue.d.ts +0 -10
- package/node_modules/@hcengineering/core/types/objvalue.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/operations.d.ts +0 -87
- package/node_modules/@hcengineering/core/types/operations.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/operator.d.ts +0 -16
- package/node_modules/@hcengineering/core/types/operator.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/predicate.d.ts +0 -6
- package/node_modules/@hcengineering/core/types/predicate.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/proxy.d.ts +0 -21
- package/node_modules/@hcengineering/core/types/proxy.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/query.d.ts +0 -21
- package/node_modules/@hcengineering/core/types/query.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/server.d.ts +0 -82
- package/node_modules/@hcengineering/core/types/server.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/status.d.ts +0 -30
- package/node_modules/@hcengineering/core/types/status.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/storage.d.ts +0 -233
- package/node_modules/@hcengineering/core/types/storage.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/time.d.ts +0 -8
- package/node_modules/@hcengineering/core/types/time.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/tx.d.ts +0 -261
- package/node_modules/@hcengineering/core/types/tx.d.ts.map +0 -1
- package/node_modules/@hcengineering/core/types/utils.d.ts +0 -207
- package/node_modules/@hcengineering/core/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/__tests__/context.test.d.ts +0 -2
- package/node_modules/@hcengineering/measurements/types/__tests__/context.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/__tests__/index.test.d.ts +0 -2
- package/node_modules/@hcengineering/measurements/types/__tests__/index.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/__tests__/metrics.test.d.ts +0 -2
- package/node_modules/@hcengineering/measurements/types/__tests__/metrics.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/__tests__/performance.test.d.ts +0 -2
- package/node_modules/@hcengineering/measurements/types/__tests__/performance.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/context.d.ts +0 -64
- package/node_modules/@hcengineering/measurements/types/context.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/index.d.ts +0 -12
- package/node_modules/@hcengineering/measurements/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/metrics.d.ts +0 -34
- package/node_modules/@hcengineering/measurements/types/metrics.d.ts.map +0 -1
- package/node_modules/@hcengineering/measurements/types/types.d.ts +0 -88
- package/node_modules/@hcengineering/measurements/types/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/__tests__/i18n.test.d.ts +0 -2
- package/node_modules/@hcengineering/platform/types/__tests__/i18n.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/__tests__/ident.test.d.ts +0 -2
- package/node_modules/@hcengineering/platform/types/__tests__/ident.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/__tests__/plugin.d.ts +0 -7
- package/node_modules/@hcengineering/platform/types/__tests__/plugin.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/__tests__/resource.test.d.ts +0 -2
- package/node_modules/@hcengineering/platform/types/__tests__/resource.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/event.d.ts +0 -39
- package/node_modules/@hcengineering/platform/types/event.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/i18n.d.ts +0 -28
- package/node_modules/@hcengineering/platform/types/i18n.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/ident.d.ts +0 -14
- package/node_modules/@hcengineering/platform/types/ident.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/index.d.ts +0 -19
- package/node_modules/@hcengineering/platform/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/metadata.d.ts +0 -38
- package/node_modules/@hcengineering/platform/types/metadata.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/platform.d.ts +0 -218
- package/node_modules/@hcengineering/platform/types/platform.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/resource.d.ts +0 -49
- package/node_modules/@hcengineering/platform/types/resource.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/status.d.ts +0 -60
- package/node_modules/@hcengineering/platform/types/status.d.ts.map +0 -1
- package/node_modules/@hcengineering/platform/types/testUtils.d.ts +0 -8
- package/node_modules/@hcengineering/platform/types/testUtils.d.ts.map +0 -1
- package/node_modules/@hcengineering/rank/types/__tests__/utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/rank/types/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/rank/types/index.d.ts +0 -3
- package/node_modules/@hcengineering/rank/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/rank/types/types.d.ts +0 -2
- package/node_modules/@hcengineering/rank/types/types.d.ts.map +0 -1
- package/node_modules/@hcengineering/rank/types/utils.d.ts +0 -6
- package/node_modules/@hcengineering/rank/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/rpc/types/index.d.ts +0 -3
- package/node_modules/@hcengineering/rpc/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/rpc/types/rpc.d.ts +0 -96
- package/node_modules/@hcengineering/rpc/types/rpc.d.ts.map +0 -1
- package/node_modules/@hcengineering/rpc/types/sliding.d.ts +0 -11
- package/node_modules/@hcengineering/rpc/types/sliding.d.ts.map +0 -1
- package/node_modules/@hcengineering/rpc/types/test/rateLimit.spec.d.ts +0 -2
- package/node_modules/@hcengineering/rpc/types/test/rateLimit.spec.d.ts.map +0 -1
- package/node_modules/@hcengineering/tags/types/analytics.d.ts +0 -5
- package/node_modules/@hcengineering/tags/types/analytics.d.ts.map +0 -1
- package/node_modules/@hcengineering/tags/types/index.d.ts +0 -105
- package/node_modules/@hcengineering/tags/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/task/types/index.d.ts +0 -227
- package/node_modules/@hcengineering/task/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/task/types/utils.d.ts +0 -61
- package/node_modules/@hcengineering/task/types/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/extensions.d.ts +0 -53
- package/node_modules/@hcengineering/text/types/extensions.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/index.d.ts +0 -13
- package/node_modules/@hcengineering/text/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/kit.d.ts +0 -12
- package/node_modules/@hcengineering/text/types/kit.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/kits/common-kit.d.ts +0 -72
- package/node_modules/@hcengineering/text/types/kits/common-kit.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/kits/server-kit.d.ts +0 -106
- package/node_modules/@hcengineering/text/types/kits/server-kit.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/marks/code.d.ts +0 -8
- package/node_modules/@hcengineering/text/types/marks/code.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/marks/colors.d.ts +0 -21
- package/node_modules/@hcengineering/text/types/marks/colors.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/marks/inlineComment.d.ts +0 -5
- package/node_modules/@hcengineering/text/types/marks/inlineComment.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/marks/noteBase.d.ts +0 -23
- package/node_modules/@hcengineering/text/types/marks/noteBase.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/marks/qmsInlineCommentMark.d.ts +0 -6
- package/node_modules/@hcengineering/text/types/marks/qmsInlineCommentMark.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/markup/__tests__/dsl.test.d.ts +0 -2
- package/node_modules/@hcengineering/text/types/markup/__tests__/dsl.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/markup/__tests__/utils.test.d.ts +0 -5
- package/node_modules/@hcengineering/text/types/markup/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/markup/utils.d.ts +0 -19
- package/node_modules/@hcengineering/text/types/markup/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/codeblock.d.ts +0 -12
- package/node_modules/@hcengineering/text/types/nodes/codeblock.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/comment.d.ts +0 -6
- package/node_modules/@hcengineering/text/types/nodes/comment.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/embed.d.ts +0 -3
- package/node_modules/@hcengineering/text/types/nodes/embed.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/emoji.d.ts +0 -17
- package/node_modules/@hcengineering/text/types/nodes/emoji.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/file.d.ts +0 -13
- package/node_modules/@hcengineering/text/types/nodes/file.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/image.d.ts +0 -52
- package/node_modules/@hcengineering/text/types/nodes/image.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/index.d.ts +0 -11
- package/node_modules/@hcengineering/text/types/nodes/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/markdown.d.ts +0 -3
- package/node_modules/@hcengineering/text/types/nodes/markdown.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/mermaid.d.ts +0 -4
- package/node_modules/@hcengineering/text/types/nodes/mermaid.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/reference.d.ts +0 -18
- package/node_modules/@hcengineering/text/types/nodes/reference.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/todo.d.ts +0 -3
- package/node_modules/@hcengineering/text/types/nodes/todo.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/nodes/utils.d.ts +0 -6
- package/node_modules/@hcengineering/text/types/nodes/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/text/types/tiptapExtensions.d.ts +0 -28
- package/node_modules/@hcengineering/text/types/tiptapExtensions.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/index.d.ts +0 -6
- package/node_modules/@hcengineering/text-core/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/__tests__/traverse.test.d.ts +0 -2
- package/node_modules/@hcengineering/text-core/types/markup/__tests__/traverse.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/__tests__/utils.test.d.ts +0 -2
- package/node_modules/@hcengineering/text-core/types/markup/__tests__/utils.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/dsl.d.ts +0 -25
- package/node_modules/@hcengineering/text-core/types/markup/dsl.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/model.d.ts +0 -74
- package/node_modules/@hcengineering/text-core/types/markup/model.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/reference.d.ts +0 -15
- package/node_modules/@hcengineering/text-core/types/markup/reference.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/traverse.d.ts +0 -6
- package/node_modules/@hcengineering/text-core/types/markup/traverse.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-core/types/markup/utils.d.ts +0 -25
- package/node_modules/@hcengineering/text-core/types/markup/utils.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-html/types/__tests__/html.test.d.ts +0 -2
- package/node_modules/@hcengineering/text-html/types/__tests__/html.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-html/types/index.d.ts +0 -6
- package/node_modules/@hcengineering/text-html/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-html/types/parser.d.ts +0 -10
- package/node_modules/@hcengineering/text-html/types/parser.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-html/types/serializer.d.ts +0 -9
- package/node_modules/@hcengineering/text-html/types/serializer.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/__tests__/markdown.test.d.ts +0 -9
- package/node_modules/@hcengineering/text-markdown/types/__tests__/markdown.test.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/compare.d.ts +0 -10
- package/node_modules/@hcengineering/text-markdown/types/compare.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/index.d.ts +0 -14
- package/node_modules/@hcengineering/text-markdown/types/index.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/marks.d.ts +0 -8
- package/node_modules/@hcengineering/text-markdown/types/marks.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/node.d.ts +0 -4
- package/node_modules/@hcengineering/text-markdown/types/node.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/parser.d.ts +0 -50
- package/node_modules/@hcengineering/text-markdown/types/parser.d.ts.map +0 -1
- package/node_modules/@hcengineering/text-markdown/types/serializer.d.ts +0 -102
- package/node_modules/@hcengineering/text-markdown/types/serializer.d.ts.map +0 -1
- package/node_modules/@hcengineering/tracker/types/analytics.d.ts +0 -24
- package/node_modules/@hcengineering/tracker/types/analytics.d.ts.map +0 -1
- package/node_modules/@hcengineering/tracker/types/index.d.ts +0 -431
- package/node_modules/@hcengineering/tracker/types/index.d.ts.map +0 -1
|
@@ -12,21 +12,24 @@ interface MenuElement {
|
|
|
12
12
|
Render the element for display in the menu. Must return a DOM
|
|
13
13
|
element and a function that can be used to update the element to
|
|
14
14
|
a new state. The `update` function must return false if the
|
|
15
|
-
update hid the entire element.
|
|
15
|
+
update hid the entire element. May also return a `focusable`
|
|
16
|
+
DOM node, which is the node that should receive focus when this
|
|
17
|
+
element is focused. If not provided, the `dom` element will be used.
|
|
16
18
|
*/
|
|
17
19
|
render(pm: EditorView): {
|
|
18
20
|
dom: HTMLElement;
|
|
19
21
|
update: (state: EditorState) => boolean;
|
|
22
|
+
focusable?: HTMLElement;
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
An icon or label that, when clicked, executes a command.
|
|
24
27
|
*/
|
|
25
|
-
declare class MenuItem implements MenuElement {
|
|
28
|
+
declare class MenuItem<E extends HTMLElement = HTMLButtonElement> implements MenuElement {
|
|
26
29
|
/**
|
|
27
30
|
The spec used to create this item.
|
|
28
31
|
*/
|
|
29
|
-
readonly spec: MenuItemSpec
|
|
32
|
+
readonly spec: MenuItemSpec<E>;
|
|
30
33
|
/**
|
|
31
34
|
Create a menu item.
|
|
32
35
|
*/
|
|
@@ -34,14 +37,14 @@ declare class MenuItem implements MenuElement {
|
|
|
34
37
|
/**
|
|
35
38
|
The spec used to create this item.
|
|
36
39
|
*/
|
|
37
|
-
spec: MenuItemSpec);
|
|
40
|
+
spec: MenuItemSpec<E>);
|
|
38
41
|
/**
|
|
39
42
|
Renders the icon according to its [display
|
|
40
43
|
spec](https://prosemirror.net/docs/ref/#menu.MenuItemSpec.display), and adds an event handler which
|
|
41
44
|
executes the command when the representation is clicked.
|
|
42
45
|
*/
|
|
43
46
|
render(view: EditorView): {
|
|
44
|
-
dom:
|
|
47
|
+
dom: HTMLButtonElement | E;
|
|
45
48
|
update: (state: EditorState) => boolean;
|
|
46
49
|
};
|
|
47
50
|
}
|
|
@@ -68,7 +71,7 @@ type IconSpec = {
|
|
|
68
71
|
/**
|
|
69
72
|
The configuration object passed to the `MenuItem` constructor.
|
|
70
73
|
*/
|
|
71
|
-
interface MenuItemSpec {
|
|
74
|
+
interface MenuItemSpec<E extends HTMLElement = HTMLButtonElement> {
|
|
72
75
|
/**
|
|
73
76
|
The function to execute when the menu item is activated.
|
|
74
77
|
*/
|
|
@@ -94,7 +97,7 @@ interface MenuItemSpec {
|
|
|
94
97
|
A function that renders the item. You must provide either this,
|
|
95
98
|
[`icon`](https://prosemirror.net/docs/ref/#menu.MenuItemSpec.icon), or [`label`](https://prosemirror.net/docs/ref/#MenuItemSpec.label).
|
|
96
99
|
*/
|
|
97
|
-
render?: (view: EditorView) =>
|
|
100
|
+
render?: (view: EditorView) => E;
|
|
98
101
|
/**
|
|
99
102
|
Describes an icon to show for this item.
|
|
100
103
|
*/
|
|
@@ -124,6 +127,7 @@ A drop-down menu, displayed as a label with a downwards-pointing
|
|
|
124
127
|
triangle to the right of it.
|
|
125
128
|
*/
|
|
126
129
|
declare class Dropdown implements MenuElement {
|
|
130
|
+
private focusTimeout;
|
|
127
131
|
/**
|
|
128
132
|
Create a dropdown wrapping the elements.
|
|
129
133
|
*/
|
|
@@ -157,13 +161,16 @@ declare class Dropdown implements MenuElement {
|
|
|
157
161
|
render(view: EditorView): {
|
|
158
162
|
dom: HTMLElement;
|
|
159
163
|
update: (state: EditorState) => boolean;
|
|
164
|
+
focusable: HTMLElement;
|
|
160
165
|
};
|
|
166
|
+
setFocusIndex(index: number): void;
|
|
161
167
|
}
|
|
162
168
|
/**
|
|
163
169
|
Represents a submenu wrapping a group of elements that start
|
|
164
170
|
hidden and expand to the right when hovered over or tapped.
|
|
165
171
|
*/
|
|
166
172
|
declare class DropdownSubmenu implements MenuElement {
|
|
173
|
+
private focusTimeout;
|
|
167
174
|
/**
|
|
168
175
|
Creates a submenu for the given group of menu elements. The
|
|
169
176
|
following options are recognized:
|
|
@@ -184,7 +191,9 @@ declare class DropdownSubmenu implements MenuElement {
|
|
|
184
191
|
render(view: EditorView): {
|
|
185
192
|
dom: HTMLElement;
|
|
186
193
|
update: (state: EditorState) => boolean;
|
|
194
|
+
focusable: HTMLElement;
|
|
187
195
|
};
|
|
196
|
+
setFocusIndex(index: number): void;
|
|
188
197
|
}
|
|
189
198
|
/**
|
|
190
199
|
Render the given, possibly nested, array of menu elements into a
|
|
@@ -195,6 +204,7 @@ be empty).
|
|
|
195
204
|
declare function renderGrouped(view: EditorView, content: readonly (readonly MenuElement[])[]): {
|
|
196
205
|
dom: DocumentFragment;
|
|
197
206
|
update: (state: EditorState) => boolean;
|
|
207
|
+
focusables: HTMLElement[];
|
|
198
208
|
};
|
|
199
209
|
/**
|
|
200
210
|
A set of basic editor-related icons. Contains the properties
|
|
@@ -209,23 +219,23 @@ declare const icons: {
|
|
|
209
219
|
/**
|
|
210
220
|
Menu item for the `joinUp` command.
|
|
211
221
|
*/
|
|
212
|
-
declare const joinUpItem: MenuItem
|
|
222
|
+
declare const joinUpItem: MenuItem<HTMLButtonElement>;
|
|
213
223
|
/**
|
|
214
224
|
Menu item for the `lift` command.
|
|
215
225
|
*/
|
|
216
|
-
declare const liftItem: MenuItem
|
|
226
|
+
declare const liftItem: MenuItem<HTMLButtonElement>;
|
|
217
227
|
/**
|
|
218
228
|
Menu item for the `selectParentNode` command.
|
|
219
229
|
*/
|
|
220
|
-
declare const selectParentNodeItem: MenuItem
|
|
230
|
+
declare const selectParentNodeItem: MenuItem<HTMLButtonElement>;
|
|
221
231
|
/**
|
|
222
232
|
Menu item for the `undo` command.
|
|
223
233
|
*/
|
|
224
|
-
declare let undoItem: MenuItem
|
|
234
|
+
declare let undoItem: MenuItem<HTMLButtonElement>;
|
|
225
235
|
/**
|
|
226
236
|
Menu item for the `redo` command.
|
|
227
237
|
*/
|
|
228
|
-
declare let redoItem: MenuItem
|
|
238
|
+
declare let redoItem: MenuItem<HTMLButtonElement>;
|
|
229
239
|
/**
|
|
230
240
|
Build a menu item for wrapping the selection in a given node type.
|
|
231
241
|
Adds `run` and `select` properties to the ones present in
|
|
@@ -234,7 +244,7 @@ attributes for the wrapping node.
|
|
|
234
244
|
*/
|
|
235
245
|
declare function wrapItem(nodeType: NodeType, options: Partial<MenuItemSpec> & {
|
|
236
246
|
attrs?: Attrs | null;
|
|
237
|
-
}): MenuItem
|
|
247
|
+
}): MenuItem<HTMLButtonElement>;
|
|
238
248
|
/**
|
|
239
249
|
Build a menu item for changing the type of the textblock around the
|
|
240
250
|
selection to the given type. Provides `run`, `active`, and `select`
|
|
@@ -243,7 +253,7 @@ be an object to provide the attributes for the textblock node.
|
|
|
243
253
|
*/
|
|
244
254
|
declare function blockTypeItem(nodeType: NodeType, options: Partial<MenuItemSpec> & {
|
|
245
255
|
attrs?: Attrs | null;
|
|
246
|
-
}): MenuItem
|
|
256
|
+
}): MenuItem<HTMLButtonElement>;
|
|
247
257
|
|
|
248
258
|
/**
|
|
249
259
|
A plugin that will place a menu bar above the editor. Note that
|
|
@@ -256,6 +266,11 @@ declare function menuBar(options: {
|
|
|
256
266
|
*/
|
|
257
267
|
content: readonly (readonly MenuElement[])[];
|
|
258
268
|
/**
|
|
269
|
+
Determines whether the menu is placed before or after the editor in the DOM.
|
|
270
|
+
The default is "before".
|
|
271
|
+
*/
|
|
272
|
+
position?: "before" | "after";
|
|
273
|
+
/**
|
|
259
274
|
Determines whether the menu floats, i.e. whether it sticks to
|
|
260
275
|
the top of the viewport when the editor is partially scrolled
|
|
261
276
|
out of view.
|
|
@@ -14,8 +14,9 @@ function hashPath(path) {
|
|
|
14
14
|
}
|
|
15
15
|
function getIcon(root, icon) {
|
|
16
16
|
let doc = (root.nodeType == 9 ? root : root.ownerDocument) || document;
|
|
17
|
-
let node = doc.createElement("
|
|
17
|
+
let node = doc.createElement("button");
|
|
18
18
|
node.className = prefix$2;
|
|
19
|
+
node.type = "button";
|
|
19
20
|
if (icon.path) {
|
|
20
21
|
let { path, width, height } = icon;
|
|
21
22
|
let name = "pm-icon-" + hashPath(path).toString(16);
|
|
@@ -78,23 +79,28 @@ class MenuItem {
|
|
|
78
79
|
let spec = this.spec;
|
|
79
80
|
let dom = spec.render ? spec.render(view)
|
|
80
81
|
: spec.icon ? getIcon(view.root, spec.icon)
|
|
81
|
-
: spec.label ? crel("
|
|
82
|
+
: spec.label ? crel("button", { type: "button" }, translate(view, spec.label))
|
|
82
83
|
: null;
|
|
83
84
|
if (!dom)
|
|
84
85
|
throw new RangeError("MenuItem without icon or label property");
|
|
85
86
|
if (spec.title) {
|
|
86
|
-
|
|
87
|
+
let title = (typeof spec.title === "function" ? spec.title(view.state) : spec.title);
|
|
87
88
|
dom.setAttribute("title", translate(view, title));
|
|
88
89
|
}
|
|
89
90
|
if (spec.class)
|
|
90
91
|
dom.classList.add(spec.class);
|
|
91
92
|
if (spec.css)
|
|
92
93
|
dom.style.cssText += spec.css;
|
|
93
|
-
dom.addEventListener("
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
dom.addEventListener("click", e => {
|
|
95
|
+
if (!dom.classList.contains(prefix$1 + "-disabled")) {
|
|
96
|
+
let setFocus = document.activeElement == dom || document.activeElement == view.dom;
|
|
96
97
|
spec.run(view.state, view.dispatch, view, e);
|
|
98
|
+
if (setFocus && document.activeElement == dom)
|
|
99
|
+
view.focus();
|
|
100
|
+
}
|
|
97
101
|
});
|
|
102
|
+
// Clicking on a menu item should not remove focus from the editor
|
|
103
|
+
dom.addEventListener("mousedown", e => e.preventDefault());
|
|
98
104
|
function update(state) {
|
|
99
105
|
if (spec.select) {
|
|
100
106
|
let selected = spec.select(state);
|
|
@@ -106,10 +112,12 @@ class MenuItem {
|
|
|
106
112
|
if (spec.enable) {
|
|
107
113
|
enabled = spec.enable(state) || false;
|
|
108
114
|
setClass(dom, prefix$1 + "-disabled", !enabled);
|
|
115
|
+
dom.setAttribute("aria-disabled", (!enabled).toString());
|
|
109
116
|
}
|
|
110
117
|
if (spec.active) {
|
|
111
118
|
let active = enabled && spec.active(state) || false;
|
|
112
119
|
setClass(dom, prefix$1 + "-active", active);
|
|
120
|
+
dom.setAttribute("aria-pressed", active.toString());
|
|
113
121
|
}
|
|
114
122
|
return true;
|
|
115
123
|
}
|
|
@@ -142,6 +150,15 @@ class Dropdown {
|
|
|
142
150
|
*/
|
|
143
151
|
options = {}) {
|
|
144
152
|
this.options = options;
|
|
153
|
+
/**
|
|
154
|
+
@internal
|
|
155
|
+
*/
|
|
156
|
+
this.focusables = [];
|
|
157
|
+
/**
|
|
158
|
+
@internal
|
|
159
|
+
*/
|
|
160
|
+
this.focusIndex = 0;
|
|
161
|
+
this.focusTimeout = -1;
|
|
145
162
|
this.options = options || {};
|
|
146
163
|
this.content = Array.isArray(content) ? content : [content];
|
|
147
164
|
}
|
|
@@ -150,45 +167,76 @@ class Dropdown {
|
|
|
150
167
|
*/
|
|
151
168
|
render(view) {
|
|
152
169
|
let content = renderDropdownItems(this.content, view);
|
|
170
|
+
this.focusables = content.focusables;
|
|
153
171
|
let win = view.dom.ownerDocument.defaultView || window;
|
|
154
|
-
let
|
|
155
|
-
|
|
172
|
+
let btn = crel("button", {
|
|
173
|
+
type: "button",
|
|
174
|
+
class: prefix$1 + "-dropdown " + (this.options.class || ""),
|
|
175
|
+
style: this.options.css,
|
|
176
|
+
"aria-haspopup": "menu",
|
|
177
|
+
"aria-expanded": "false"
|
|
178
|
+
}, translate(view, this.options.label || ""));
|
|
156
179
|
if (this.options.title)
|
|
157
|
-
|
|
158
|
-
let wrap = crel("div", { class: prefix$1 + "-dropdown-wrap" },
|
|
180
|
+
btn.setAttribute("title", translate(view, this.options.title));
|
|
181
|
+
let wrap = crel("div", { class: prefix$1 + "-dropdown-wrap" }, btn);
|
|
159
182
|
let open = null;
|
|
160
183
|
let listeningOnClose = null;
|
|
161
184
|
let close = () => {
|
|
162
185
|
if (open && open.close()) {
|
|
163
186
|
open = null;
|
|
164
|
-
win.removeEventListener("
|
|
187
|
+
win.removeEventListener("click", listeningOnClose);
|
|
165
188
|
}
|
|
166
189
|
};
|
|
167
|
-
|
|
168
|
-
e.preventDefault();
|
|
190
|
+
btn.addEventListener("click", e => {
|
|
169
191
|
markMenuEvent(e);
|
|
170
192
|
if (open) {
|
|
171
193
|
close();
|
|
172
194
|
}
|
|
173
195
|
else {
|
|
174
|
-
open = this.expand(wrap, content.dom);
|
|
175
|
-
win.addEventListener("
|
|
196
|
+
open = this.expand(wrap, content.dom, btn);
|
|
197
|
+
win.addEventListener("click", listeningOnClose = () => {
|
|
176
198
|
if (!isMenuEvent(wrap))
|
|
177
199
|
close();
|
|
178
200
|
});
|
|
201
|
+
// If triggered using the keyboard, move focus to first item
|
|
202
|
+
if (e.detail === 0) {
|
|
203
|
+
let focusIndex = findFocusableIndex(this.focusables, -1, 1);
|
|
204
|
+
if (focusIndex != null)
|
|
205
|
+
this.setFocusIndex(focusIndex);
|
|
206
|
+
}
|
|
207
|
+
open.node.addEventListener("keydown", (event) => {
|
|
208
|
+
markMenuEvent(event);
|
|
209
|
+
if (keyboardMoveFocus(this, event, "vertical")) ;
|
|
210
|
+
else if (event.key === "Escape") {
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
event.stopPropagation();
|
|
213
|
+
btn.focus();
|
|
214
|
+
close();
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
open.node.addEventListener("focusout", () => {
|
|
218
|
+
clearTimeout(this.focusTimeout);
|
|
219
|
+
this.focusTimeout = setTimeout(() => {
|
|
220
|
+
let active = win.document.activeElement;
|
|
221
|
+
if (active && open && !open.node.contains(active))
|
|
222
|
+
close();
|
|
223
|
+
}, 20);
|
|
224
|
+
});
|
|
179
225
|
}
|
|
180
226
|
});
|
|
227
|
+
// Clicking on a dropdown should not remove focus from the editor
|
|
228
|
+
btn.addEventListener("mousedown", e => e.preventDefault());
|
|
181
229
|
function update(state) {
|
|
182
230
|
let inner = content.update(state);
|
|
183
231
|
wrap.style.display = inner ? "" : "none";
|
|
184
232
|
return inner;
|
|
185
233
|
}
|
|
186
|
-
return { dom: wrap, update };
|
|
234
|
+
return { dom: wrap, update, focusable: btn };
|
|
187
235
|
}
|
|
188
236
|
/**
|
|
189
237
|
@internal
|
|
190
238
|
*/
|
|
191
|
-
expand(dom, items) {
|
|
239
|
+
expand(dom, items, trigger) {
|
|
192
240
|
let menuDOM = crel("div", { class: prefix$1 + "-dropdown-menu " + (this.options.class || "") }, items);
|
|
193
241
|
let done = false;
|
|
194
242
|
function close() {
|
|
@@ -196,20 +244,72 @@ class Dropdown {
|
|
|
196
244
|
return false;
|
|
197
245
|
done = true;
|
|
198
246
|
dom.removeChild(menuDOM);
|
|
247
|
+
trigger.ariaControlsElements = [];
|
|
248
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
199
249
|
return true;
|
|
200
250
|
}
|
|
201
251
|
dom.appendChild(menuDOM);
|
|
252
|
+
trigger.ariaControlsElements = [items];
|
|
253
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
202
254
|
return { close, node: menuDOM };
|
|
203
255
|
}
|
|
256
|
+
setFocusIndex(index) {
|
|
257
|
+
if (this.focusables.length <= 1)
|
|
258
|
+
return;
|
|
259
|
+
this.focusables[this.focusIndex].setAttribute("tabindex", "-1");
|
|
260
|
+
this.focusIndex = index;
|
|
261
|
+
let nextFocusItem = this.focusables[index];
|
|
262
|
+
nextFocusItem.setAttribute("tabindex", "0");
|
|
263
|
+
nextFocusItem.focus();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function findFocusableIndex(focusables, startIndex, delta) {
|
|
267
|
+
let length = focusables.length;
|
|
268
|
+
for (let i = 0, index = startIndex + delta;; index += delta, i++) {
|
|
269
|
+
let normIndex = (index + length) % length;
|
|
270
|
+
if (focusables[normIndex].style.display != "none")
|
|
271
|
+
return normIndex;
|
|
272
|
+
if (i == length)
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function keyboardMoveFocus(control, event, orientation) {
|
|
277
|
+
let { focusables, focusIndex } = control;
|
|
278
|
+
let move = event.key == (orientation == "vertical" ? "ArrowDown" : "ArrowRight") ? findFocusableIndex(focusables, focusIndex, 1) :
|
|
279
|
+
event.key == (orientation == "vertical" ? "ArrowUp" : "ArrowLeft") ? findFocusableIndex(focusables, focusIndex, -1) :
|
|
280
|
+
event.key == "Home" ? findFocusableIndex(focusables, -1, 1) :
|
|
281
|
+
event.key == "End" ? findFocusableIndex(focusables, focusables.length, -1) : null;
|
|
282
|
+
if (move == null)
|
|
283
|
+
return false;
|
|
284
|
+
event.preventDefault();
|
|
285
|
+
event.stopPropagation();
|
|
286
|
+
control.setFocusIndex(move);
|
|
287
|
+
return true;
|
|
204
288
|
}
|
|
205
289
|
function renderDropdownItems(items, view) {
|
|
206
|
-
let
|
|
290
|
+
let elts = [], focusables = [], updates = [];
|
|
207
291
|
for (let i = 0; i < items.length; i++) {
|
|
208
|
-
let
|
|
209
|
-
|
|
292
|
+
let item = items[i];
|
|
293
|
+
let { dom, update, focusable } = item.render(view);
|
|
294
|
+
elts.push(crel("li", {
|
|
295
|
+
class: `${prefix$1}-dropdown-item`,
|
|
296
|
+
role: "menuitem",
|
|
297
|
+
"tabindex": "-1"
|
|
298
|
+
}, dom));
|
|
299
|
+
focusables.push(focusable || dom);
|
|
210
300
|
updates.push(update);
|
|
211
301
|
}
|
|
212
|
-
|
|
302
|
+
function update(state) {
|
|
303
|
+
let something = false;
|
|
304
|
+
for (let i = 0; i < elts.length; i++) {
|
|
305
|
+
let dom = elts[i], up = updates[i](state);
|
|
306
|
+
if (up)
|
|
307
|
+
something = true;
|
|
308
|
+
dom.style.display = up ? "" : "none";
|
|
309
|
+
}
|
|
310
|
+
return something;
|
|
311
|
+
}
|
|
312
|
+
return { dom: crel("ul", { role: "menu" }, elts), update, focusables };
|
|
213
313
|
}
|
|
214
314
|
function combineUpdates(updates, nodes) {
|
|
215
315
|
return (state) => {
|
|
@@ -238,6 +338,15 @@ class DropdownSubmenu {
|
|
|
238
338
|
*/
|
|
239
339
|
options = {}) {
|
|
240
340
|
this.options = options;
|
|
341
|
+
/**
|
|
342
|
+
@internal
|
|
343
|
+
*/
|
|
344
|
+
this.focusables = [];
|
|
345
|
+
/**
|
|
346
|
+
@internal
|
|
347
|
+
*/
|
|
348
|
+
this.focusIndex = 0;
|
|
349
|
+
this.focusTimeout = -1;
|
|
241
350
|
this.content = Array.isArray(content) ? content : [content];
|
|
242
351
|
}
|
|
243
352
|
/**
|
|
@@ -245,29 +354,70 @@ class DropdownSubmenu {
|
|
|
245
354
|
*/
|
|
246
355
|
render(view) {
|
|
247
356
|
let items = renderDropdownItems(this.content, view);
|
|
357
|
+
this.focusables = items.focusables;
|
|
248
358
|
let win = view.dom.ownerDocument.defaultView || window;
|
|
249
|
-
let
|
|
250
|
-
let wrap = crel("div", { class: prefix$1 + "-submenu-wrap" },
|
|
359
|
+
let btn = crel("button", { type: "button", class: prefix$1 + "-submenu-label" }, translate(view, this.options.label || ""));
|
|
360
|
+
let wrap = crel("div", { class: prefix$1 + "-submenu-wrap" }, btn, crel("div", { class: prefix$1 + "-submenu" }, items.dom));
|
|
251
361
|
let listeningOnClose = null;
|
|
252
|
-
|
|
362
|
+
let openSubmenu = (e) => {
|
|
253
363
|
e.preventDefault();
|
|
364
|
+
e.stopPropagation();
|
|
254
365
|
markMenuEvent(e);
|
|
255
|
-
setClass(wrap, prefix$1 + "-submenu-wrap-active",
|
|
366
|
+
setClass(wrap, prefix$1 + "-submenu-wrap-active", true);
|
|
256
367
|
if (!listeningOnClose)
|
|
257
|
-
win.addEventListener("
|
|
368
|
+
win.addEventListener("click", listeningOnClose = () => {
|
|
258
369
|
if (!isMenuEvent(wrap)) {
|
|
259
370
|
wrap.classList.remove(prefix$1 + "-submenu-wrap-active");
|
|
260
|
-
win.removeEventListener("
|
|
371
|
+
win.removeEventListener("click", listeningOnClose);
|
|
261
372
|
listeningOnClose = null;
|
|
262
373
|
}
|
|
263
374
|
});
|
|
375
|
+
if (!(e.type == "click" && e.detail)) {
|
|
376
|
+
let focusIndex = findFocusableIndex(this.focusables, -1, 1);
|
|
377
|
+
if (focusIndex != null)
|
|
378
|
+
this.setFocusIndex(focusIndex);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
btn.addEventListener("click", openSubmenu);
|
|
382
|
+
btn.addEventListener("keydown", e => {
|
|
383
|
+
if (e.key === "ArrowRight")
|
|
384
|
+
openSubmenu(e);
|
|
385
|
+
});
|
|
386
|
+
// Clicking on an item should not remove focus from the editor
|
|
387
|
+
btn.addEventListener("mousedown", e => e.preventDefault());
|
|
388
|
+
items.dom.addEventListener("keydown", (event) => {
|
|
389
|
+
markMenuEvent(event);
|
|
390
|
+
if (keyboardMoveFocus(this, event, "vertical")) ;
|
|
391
|
+
else if (event.key === "Escape" || event.key === "ArrowLeft") {
|
|
392
|
+
event.preventDefault();
|
|
393
|
+
event.stopPropagation();
|
|
394
|
+
setClass(wrap, prefix$1 + "-submenu-wrap-active", false);
|
|
395
|
+
btn.focus();
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
items.dom.addEventListener("focusout", () => {
|
|
399
|
+
clearTimeout(this.focusTimeout);
|
|
400
|
+
this.focusTimeout = setTimeout(() => {
|
|
401
|
+
let active = win.document.activeElement;
|
|
402
|
+
if (active && !items.dom.contains(active))
|
|
403
|
+
wrap.classList.remove(prefix$1 + "-submenu-wrap-active");
|
|
404
|
+
}, 20);
|
|
264
405
|
});
|
|
265
406
|
function update(state) {
|
|
266
407
|
let inner = items.update(state);
|
|
267
408
|
wrap.style.display = inner ? "" : "none";
|
|
268
409
|
return inner;
|
|
269
410
|
}
|
|
270
|
-
return { dom: wrap, update };
|
|
411
|
+
return { dom: wrap, update, focusable: btn };
|
|
412
|
+
}
|
|
413
|
+
setFocusIndex(index) {
|
|
414
|
+
if (this.focusables.length <= 1)
|
|
415
|
+
return;
|
|
416
|
+
this.focusables[this.focusIndex].setAttribute("tabindex", "-1");
|
|
417
|
+
this.focusIndex = index;
|
|
418
|
+
let nextFocusItem = this.focusables[index];
|
|
419
|
+
nextFocusItem.setAttribute("tabindex", "0");
|
|
420
|
+
nextFocusItem.focus();
|
|
271
421
|
}
|
|
272
422
|
}
|
|
273
423
|
/**
|
|
@@ -278,11 +428,12 @@ be empty).
|
|
|
278
428
|
*/
|
|
279
429
|
function renderGrouped(view, content) {
|
|
280
430
|
let result = document.createDocumentFragment();
|
|
281
|
-
let updates = [], separators = [];
|
|
431
|
+
let updates = [], focusables = [], separators = [];
|
|
282
432
|
for (let i = 0; i < content.length; i++) {
|
|
283
433
|
let items = content[i], localUpdates = [], localNodes = [];
|
|
284
434
|
for (let j = 0; j < items.length; j++) {
|
|
285
|
-
let { dom, update } = items[j].render(view);
|
|
435
|
+
let { dom, update, focusable } = items[j].render(view);
|
|
436
|
+
focusables.push(focusable || dom);
|
|
286
437
|
let span = crel("span", { class: prefix$1 + "item" }, dom);
|
|
287
438
|
result.appendChild(span);
|
|
288
439
|
localNodes.push(span);
|
|
@@ -306,10 +457,10 @@ function renderGrouped(view, content) {
|
|
|
306
457
|
}
|
|
307
458
|
return something;
|
|
308
459
|
}
|
|
309
|
-
return { dom: result, update };
|
|
460
|
+
return { dom: result, update, focusables };
|
|
310
461
|
}
|
|
311
462
|
function separator() {
|
|
312
|
-
return crel("span", { class: prefix$1 + "separator" });
|
|
463
|
+
return crel("span", { class: prefix$1 + "separator", role: "separator" });
|
|
313
464
|
}
|
|
314
465
|
/**
|
|
315
466
|
A set of basic editor-related icons. Contains the properties
|
|
@@ -479,6 +630,8 @@ class MenuBarView {
|
|
|
479
630
|
constructor(editorView, options) {
|
|
480
631
|
this.editorView = editorView;
|
|
481
632
|
this.options = options;
|
|
633
|
+
this.focusables = [];
|
|
634
|
+
this.focusIndex = 0;
|
|
482
635
|
this.spacer = null;
|
|
483
636
|
this.maxHeight = 0;
|
|
484
637
|
this.widthForMaxHeight = 0;
|
|
@@ -486,15 +639,21 @@ class MenuBarView {
|
|
|
486
639
|
this.scrollHandler = null;
|
|
487
640
|
this.root = editorView.root;
|
|
488
641
|
this.wrapper = crel("div", { class: prefix + "-wrapper" });
|
|
489
|
-
this.menu = this.wrapper.appendChild(crel("div", { class: prefix }));
|
|
642
|
+
this.menu = this.wrapper.appendChild(crel("div", { class: prefix, role: "toolbar" }));
|
|
490
643
|
this.menu.className = prefix;
|
|
644
|
+
this.menu.ariaControlsElements = [editorView.dom];
|
|
491
645
|
if (editorView.dom.parentNode)
|
|
492
646
|
editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom);
|
|
493
|
-
|
|
494
|
-
|
|
647
|
+
if (options.position === "after") {
|
|
648
|
+
this.wrapper.insertBefore(editorView.dom, this.wrapper.firstChild);
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
this.wrapper.appendChild(editorView.dom);
|
|
652
|
+
}
|
|
653
|
+
let { dom, update, focusables } = renderGrouped(this.editorView, this.options.content);
|
|
495
654
|
this.contentUpdate = update;
|
|
655
|
+
this.focusables = focusables;
|
|
496
656
|
this.menu.appendChild(dom);
|
|
497
|
-
this.update();
|
|
498
657
|
if (options.floating && !isIOS()) {
|
|
499
658
|
this.updateFloat();
|
|
500
659
|
let potentialScrollers = getAllWrapping(this.wrapper);
|
|
@@ -507,6 +666,34 @@ class MenuBarView {
|
|
|
507
666
|
};
|
|
508
667
|
potentialScrollers.forEach(el => el.addEventListener('scroll', this.scrollHandler));
|
|
509
668
|
}
|
|
669
|
+
// update focusIndex on focus change
|
|
670
|
+
for (let i = 0; i < focusables.length; i++) {
|
|
671
|
+
let focusable = focusables[i];
|
|
672
|
+
// set `tabindex` to -1 for all but the first focusable item
|
|
673
|
+
if (i)
|
|
674
|
+
focusable.setAttribute("tabindex", "-1");
|
|
675
|
+
focusable.addEventListener("focus", () => {
|
|
676
|
+
if (this.focusIndex === i)
|
|
677
|
+
return;
|
|
678
|
+
let prevFocusItem = this.focusables[this.focusIndex];
|
|
679
|
+
prevFocusItem.setAttribute("tabindex", "-1");
|
|
680
|
+
focusable.setAttribute("tabindex", "0");
|
|
681
|
+
this.focusIndex = i;
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
this.menu.addEventListener("keydown", (event) => {
|
|
685
|
+
keyboardMoveFocus(this, event, "horizontal");
|
|
686
|
+
});
|
|
687
|
+
this.update();
|
|
688
|
+
}
|
|
689
|
+
setFocusIndex(index) {
|
|
690
|
+
if (this.focusables.length <= 1)
|
|
691
|
+
return;
|
|
692
|
+
this.focusables[this.focusIndex].setAttribute("tabindex", "-1");
|
|
693
|
+
this.focusIndex = index;
|
|
694
|
+
let nextFocusItem = this.focusables[index];
|
|
695
|
+
nextFocusItem.setAttribute("tabindex", "0");
|
|
696
|
+
nextFocusItem.focus();
|
|
510
697
|
}
|
|
511
698
|
update() {
|
|
512
699
|
if (this.editorView.root != this.root) {
|
|
@@ -515,7 +702,13 @@ class MenuBarView {
|
|
|
515
702
|
this.menu.replaceChild(dom, this.menu.firstChild);
|
|
516
703
|
this.root = this.editorView.root;
|
|
517
704
|
}
|
|
705
|
+
let active = this.editorView.dom.ownerDocument.activeElement == this.focusables[this.focusIndex];
|
|
518
706
|
this.contentUpdate(this.editorView.state);
|
|
707
|
+
if (active && this.focusables[this.focusIndex].style.display == "none") {
|
|
708
|
+
let next = findFocusableIndex(this.focusables, this.focusIndex, 1);
|
|
709
|
+
if (next != null)
|
|
710
|
+
this.setFocusIndex(next);
|
|
711
|
+
}
|
|
519
712
|
if (this.floating) {
|
|
520
713
|
this.updateScrollCursor();
|
|
521
714
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prosemirror-menu",
|
|
3
|
-
"version": "1.2
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Simple menu elements for ProseMirror",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "git://
|
|
28
|
+
"url": "git+https://code.haverbeke.berlin/prosemirror/prosemirror-menu.git"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"crelt": "^1.0.0",
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
+
# prosemirror-menu
|
|
2
|
+
|
|
3
|
+
[ [**WEBSITE**](https://prosemirror.net) | [**ISSUES**](https://code.haverbeke.berlin/prosemirror/prosemirror-menu/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) ]
|
|
4
|
+
|
|
5
|
+
This is a non-core example module for [ProseMirror](https://prosemirror.net).
|
|
6
|
+
ProseMirror is a well-behaved rich semantic content editor based on
|
|
7
|
+
contentEditable, with support for collaborative editing and custom
|
|
8
|
+
document schemas.
|
|
9
|
+
|
|
10
|
+
This module defines an abstraction for building a menu for the
|
|
11
|
+
ProseMirror editor, along with an implementation of a menubar.
|
|
12
|
+
|
|
13
|
+
**Note** that this module exists mostly as an example of how you
|
|
14
|
+
_might_ want to approach adding a menu to ProseMirror, but is not
|
|
15
|
+
maintained as actively as the core modules related to actual editing.
|
|
16
|
+
If you want to extend or improve it, the recommended way is to fork
|
|
17
|
+
it. If you are interested in maintaining a serious menu component for
|
|
18
|
+
ProseMirror, publish your fork, and if it works for me, I'll gladly
|
|
19
|
+
deprecate this in favor of your module.
|
|
20
|
+
|
|
21
|
+
This code is released under an
|
|
22
|
+
[MIT license](https://code.haverbeke.berlin/prosemirror/prosemirror/src/branch/main/LICENSE).
|
|
23
|
+
There's a [forum](http://discuss.prosemirror.net) for general
|
|
24
|
+
discussion and support requests, and the
|
|
25
|
+
[bug tracker](https://code.haverbeke.berlin/prosemirror/prosemirror-menu/issues)
|
|
26
|
+
is the place to report issues.
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
1
30
|
This module defines a number of building blocks for ProseMirror menus,
|
|
2
31
|
along with a [menu bar](#menu.menuBar) implementation.
|
|
3
32
|
|
|
4
33
|
When using this module, you should make sure its
|
|
5
|
-
[`style/menu.css`](https://
|
|
34
|
+
[`style/menu.css`](https://code.haverbeke.berlin/prosemirror/prosemirror-menu/src/branch/main/style/menu.css)
|
|
6
35
|
file is loaded into your page.
|
|
7
36
|
|
|
8
37
|
@MenuElement
|
|
@@ -13,10 +13,11 @@ function hashPath(path: string) {
|
|
|
13
13
|
export function getIcon(
|
|
14
14
|
root: Document | ShadowRoot,
|
|
15
15
|
icon: {path: string, width: number, height: number} | {text: string, css?: string} | {dom: Node}
|
|
16
|
-
):
|
|
16
|
+
): HTMLButtonElement {
|
|
17
17
|
let doc = (root.nodeType == 9 ? root as Document : root.ownerDocument) || document
|
|
18
|
-
let node = doc.createElement("
|
|
18
|
+
let node = doc.createElement("button")
|
|
19
19
|
node.className = prefix
|
|
20
|
+
node.type = "button"
|
|
20
21
|
if ((icon as any).path) {
|
|
21
22
|
let {path, width, height} = icon as {path: string, width: number, height: number}
|
|
22
23
|
let name = "pm-icon-" + hashPath(path).toString(16)
|