@segnavia/markdown-editor 0.50.0 → 0.51.0
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fontManifestWithReferences } from "@segnavia/format";
|
|
1
2
|
import { FontRefusedError, appNames, refuseMissingFontSource, requireAppFontName, uniqueFontReferences } from "@segnavia/frame/fonts";
|
|
2
3
|
//#region src/markdown-editor-fonts.ts
|
|
3
4
|
function nativeFace(face) {
|
|
@@ -10,7 +11,8 @@ function nativeFace(face) {
|
|
|
10
11
|
async function registerMarkdownEditorFonts(element, references, fonts, signal) {
|
|
11
12
|
const unique = uniqueFontReferences(references);
|
|
12
13
|
if (!fonts) {
|
|
13
|
-
|
|
14
|
+
const converted = fontManifestWithReferences(void 0, unique);
|
|
15
|
+
refuseMissingFontSource(converted.manifest, converted.undeclared, "markdown editor");
|
|
14
16
|
return () => void 0;
|
|
15
17
|
}
|
|
16
18
|
const app = /* @__PURE__ */ new Map();
|
|
@@ -2,8 +2,8 @@ import { MarkdownEditorLabels } from "./markdown-editor-labels.js";
|
|
|
2
2
|
import { MarkdownTitleSource } from "./markdown-editor-model.js";
|
|
3
3
|
import { MarkdownEditorCommand, MarkdownEditorCommandArgs, MarkdownEditorMode } from "./markdown-editor-policy.js";
|
|
4
4
|
import { AlertLabels } from "@segnavia/html";
|
|
5
|
-
import { FontsOptions } from "@segnavia/frame/fonts";
|
|
6
5
|
import { FontReference } from "@segnavia/format";
|
|
6
|
+
import { FontsOptions } from "@segnavia/frame/fonts";
|
|
7
7
|
//#region src/markdown-editor-types.d.ts
|
|
8
8
|
export type MarkdownEditorStateDetail = Readonly<{
|
|
9
9
|
marks: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RAW_INLINE_ATTRIBUTE } from "./markdown-rich-raw-inline.js";
|
|
2
|
-
import { NodeSelection } from "@tiptap/pm/state";
|
|
3
2
|
import { resolveDirection } from "@segnavia/format";
|
|
3
|
+
import { NodeSelection } from "@tiptap/pm/state";
|
|
4
4
|
//#region src/markdown-raw-inline-indication.ts
|
|
5
5
|
const rawInlineSelector = `[${RAW_INLINE_ATTRIBUTE}]`;
|
|
6
6
|
function rawInlineElement(target) {
|
|
@@ -5,6 +5,7 @@ import { labelRawInline, selectedRawInlineAtom } from "./markdown-raw-inline-ind
|
|
|
5
5
|
import { richExtensions } from "./markdown-rich-extensions.js";
|
|
6
6
|
import { safeMarkdownUrl } from "@segnavia/html";
|
|
7
7
|
import { HEADLESS_ELEMENTS, SegnaviaPage, createPageElement } from "@segnavia/frame";
|
|
8
|
+
import { persistedFontManifestWithReferences } from "@segnavia/format";
|
|
8
9
|
import { Editor } from "@tiptap/core";
|
|
9
10
|
//#region src/markdown-rich-editor.ts
|
|
10
11
|
if (!customElements.get(HEADLESS_ELEMENTS.page)) customElements.define(HEADLESS_ELEMENTS.page, SegnaviaPage);
|
|
@@ -32,7 +33,7 @@ function lockedView(options) {
|
|
|
32
33
|
type: "document",
|
|
33
34
|
kind: "page",
|
|
34
35
|
settings: { scripts: "refuse" },
|
|
35
|
-
style: { fonts: current.fontReferences },
|
|
36
|
+
style: { fonts: persistedFontManifestWithReferences(void 0, current.fontReferences) },
|
|
36
37
|
children: [{
|
|
37
38
|
type: "page",
|
|
38
39
|
body: { markdown: String(node.attrs.source ?? "") }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segnavia/markdown-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@segnavia/format": "0.
|
|
40
|
-
"@segnavia/frame": "0.
|
|
41
|
-
"@segnavia/html": "0.
|
|
39
|
+
"@segnavia/format": "0.51.0",
|
|
40
|
+
"@segnavia/frame": "0.51.0",
|
|
41
|
+
"@segnavia/html": "0.51.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@codemirror/commands": "^6.11.1",
|