@owomark/view 0.1.6 → 0.1.8
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 +1 -1
- package/dist/.build-manifest.json +78 -0
- package/dist/{chunk-WA6XHBZS.js → chunk-656BO747.js} +1 -0
- package/dist/{chunk-KHKPOH74.js → chunk-BPOZMVU7.js} +1 -1
- package/dist/index.d.ts +17 -11
- package/dist/index.js +475 -91
- package/dist/internal/virtual/height-estimator.d.ts +1 -1
- package/dist/internal/virtual/height-estimator.js +1 -1
- package/dist/internal/virtual/viewport-manager.js +1 -1
- package/dist/preview-render.worker.js +369 -0
- package/dist/{types-DsL_4tUb.d.ts → types-D4TVpyP7.d.ts} +20 -10
- package/package.json +2 -2
- package/src/style.css +2 -0
- package/src/theme/cards.css +50 -0
- package/src/theme/dark.css +2 -0
- package/src/theme/light.css +2 -0
- package/src/theme/owomark.css +6 -0
- package/src/theme/preview.css +15 -0
- package/src/theme/toolbar.css +104 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install @owomark/view
|
|
|
10
10
|
|
|
11
11
|
## Scope
|
|
12
12
|
|
|
13
|
-
- `createOwoMarkView()`
|
|
13
|
+
- `createOwoMarkView()` for interactive editing
|
|
14
14
|
- `createOwoMarkPreviewEngine()` and renderer registry APIs for preview DOM rendering
|
|
15
15
|
- `PreviewDomPatcher` and `SideAnnotationPositioner` for browser layout work
|
|
16
16
|
- `getThemeClassName()`, `light.css`, `dark.css`, `owomark.css`, `preview.css`, `slash-menu.css`, `side-annotation.css`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageName": "@owomark/view",
|
|
4
|
+
"packagePath": "owomark/packages/owomark-view",
|
|
5
|
+
"packageFingerprint": "d8f4b1d986a0675fda2192c0d468451889972322aed165be9fc65f4565475ef6",
|
|
6
|
+
"workspaceFingerprint": "947c542dce3fedf4a242f46f580a35ff336c5a64ac6448d24339650ad9dac6a1",
|
|
7
|
+
"builtAt": "2026-04-23T10:30:21.564Z",
|
|
8
|
+
"builderVersion": "2026-04-22-industrialization-v1",
|
|
9
|
+
"inputFiles": [
|
|
10
|
+
"owomark/package.json",
|
|
11
|
+
"owomark/packages/owomark-view/package.json",
|
|
12
|
+
"owomark/packages/owomark-view/src/dom/patcher.ts",
|
|
13
|
+
"owomark/packages/owomark-view/src/dom/side-annotation-positioner.ts",
|
|
14
|
+
"owomark/packages/owomark-view/src/dom/skeleton.ts",
|
|
15
|
+
"owomark/packages/owomark-view/src/dom/slash-menu.ts",
|
|
16
|
+
"owomark/packages/owomark-view/src/editor.ts",
|
|
17
|
+
"owomark/packages/owomark-view/src/engine.ts",
|
|
18
|
+
"owomark/packages/owomark-view/src/index.ts",
|
|
19
|
+
"owomark/packages/owomark-view/src/internal/testing/vanilla-editor.ts",
|
|
20
|
+
"owomark/packages/owomark-view/src/internal/virtual/block-layout-map.ts",
|
|
21
|
+
"owomark/packages/owomark-view/src/internal/virtual/height-cache.ts",
|
|
22
|
+
"owomark/packages/owomark-view/src/internal/virtual/height-estimator.ts",
|
|
23
|
+
"owomark/packages/owomark-view/src/internal/virtual/viewport-manager.ts",
|
|
24
|
+
"owomark/packages/owomark-view/src/renderer/cards-renderer.ts",
|
|
25
|
+
"owomark/packages/owomark-view/src/renderer/default-renderer.ts",
|
|
26
|
+
"owomark/packages/owomark-view/src/renderer/highlight-cache.ts",
|
|
27
|
+
"owomark/packages/owomark-view/src/renderer/registry.ts",
|
|
28
|
+
"owomark/packages/owomark-view/src/renderer/side-annotation-renderer.ts",
|
|
29
|
+
"owomark/packages/owomark-view/src/strategies/incremental.ts",
|
|
30
|
+
"owomark/packages/owomark-view/src/strategies/shared.ts",
|
|
31
|
+
"owomark/packages/owomark-view/src/strategies/virtual.ts",
|
|
32
|
+
"owomark/packages/owomark-view/src/style.css",
|
|
33
|
+
"owomark/packages/owomark-view/src/theme.ts",
|
|
34
|
+
"owomark/packages/owomark-view/src/theme/cards.css",
|
|
35
|
+
"owomark/packages/owomark-view/src/theme/dark.css",
|
|
36
|
+
"owomark/packages/owomark-view/src/theme/light.css",
|
|
37
|
+
"owomark/packages/owomark-view/src/theme/owomark.css",
|
|
38
|
+
"owomark/packages/owomark-view/src/theme/preview.css",
|
|
39
|
+
"owomark/packages/owomark-view/src/theme/side-annotation.css",
|
|
40
|
+
"owomark/packages/owomark-view/src/theme/slash-menu.css",
|
|
41
|
+
"owomark/packages/owomark-view/src/theme/toolbar.css",
|
|
42
|
+
"owomark/packages/owomark-view/src/types.ts",
|
|
43
|
+
"owomark/packages/owomark-view/src/view-engine.ts",
|
|
44
|
+
"owomark/packages/owomark-view/src/virtual/block-layout-map.ts",
|
|
45
|
+
"owomark/packages/owomark-view/src/virtual/height-cache.ts",
|
|
46
|
+
"owomark/packages/owomark-view/src/virtual/height-estimator.ts",
|
|
47
|
+
"owomark/packages/owomark-view/src/virtual/offscreen-measurer.ts",
|
|
48
|
+
"owomark/packages/owomark-view/src/virtual/viewport-manager.ts",
|
|
49
|
+
"owomark/packages/owomark-view/src/worker/preview-render.worker.ts",
|
|
50
|
+
"owomark/packages/owomark-view/src/worker/preview-task-scheduler.ts",
|
|
51
|
+
"owomark/packages/owomark-view/src/worker/renderer-registry.ts",
|
|
52
|
+
"owomark/packages/owomark-view/src/worker/types.ts",
|
|
53
|
+
"owomark/packages/owomark-view/tsconfig.json",
|
|
54
|
+
"owomark/packages/owomark-view/tsup.config.ts",
|
|
55
|
+
"package-lock.json"
|
|
56
|
+
],
|
|
57
|
+
"artifactFiles": [
|
|
58
|
+
"dist/chunk-3CKPBCIP.js",
|
|
59
|
+
"dist/chunk-656BO747.js",
|
|
60
|
+
"dist/chunk-6LWPFJCB.js",
|
|
61
|
+
"dist/chunk-BPOZMVU7.js",
|
|
62
|
+
"dist/index.d.ts",
|
|
63
|
+
"dist/index.js",
|
|
64
|
+
"dist/internal/virtual/block-layout-map.d.ts",
|
|
65
|
+
"dist/internal/virtual/block-layout-map.js",
|
|
66
|
+
"dist/internal/virtual/height-cache.d.ts",
|
|
67
|
+
"dist/internal/virtual/height-cache.js",
|
|
68
|
+
"dist/internal/virtual/height-estimator.d.ts",
|
|
69
|
+
"dist/internal/virtual/height-estimator.js",
|
|
70
|
+
"dist/internal/virtual/viewport-manager.d.ts",
|
|
71
|
+
"dist/internal/virtual/viewport-manager.js",
|
|
72
|
+
"dist/preview-render.worker.js",
|
|
73
|
+
"dist/types-D4TVpyP7.d.ts"
|
|
74
|
+
],
|
|
75
|
+
"localDependencyFingerprints": {
|
|
76
|
+
"@owomark/core": "8db4cbc05bde390fdc26e52f8d57f3f0fd5bfbf27af1ef9991bf015a3f7b5f69"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -108,6 +108,7 @@ var VirtualViewportManager = class {
|
|
|
108
108
|
wrapper.setAttribute(BLOCK_ID_ATTR, block.blockId);
|
|
109
109
|
wrapper.setAttribute(SOURCE_START_ATTR, String(block.startLine));
|
|
110
110
|
wrapper.setAttribute(SOURCE_END_ATTR, String(block.endLine));
|
|
111
|
+
wrapper.style.display = "flow-root";
|
|
111
112
|
wrapper.style.position = "absolute";
|
|
112
113
|
wrapper.style.left = "0";
|
|
113
114
|
wrapper.style.width = "100%";
|
|
@@ -13,7 +13,7 @@ var HEAVY_MEDIUM_HEIGHT = 200;
|
|
|
13
13
|
var HEAVY_LARGE_HEIGHT = 500;
|
|
14
14
|
function estimateBlockHeight(block, registry) {
|
|
15
15
|
const lineCount = block.endLine - block.startLine + 1;
|
|
16
|
-
if (registry?.isHeavy(block
|
|
16
|
+
if (registry?.isHeavy(block)) {
|
|
17
17
|
return estimateHeavyBlockHeight(lineCount);
|
|
18
18
|
}
|
|
19
19
|
if (block.kind === "code-fence") {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OwoMarkCore,
|
|
1
|
+
import { OwoMarkCore, PreviewBlock, CardsFamilyAttributes, CARDS_FAMILY_CUSTOM_BLOCK_KEY } from '@owomark/core';
|
|
2
2
|
export { DocumentChangeCallback } from '@owomark/core';
|
|
3
|
-
import { O as OwoMarkPreviewEngineOptions, a as OwoMarkPreviewEngine, P as PreviewRendererRegistry, b as PreviewTaskScheduler } from './types-
|
|
4
|
-
export { c as PreviewBlockMetadata, d as PreviewBlockRenderer, e as PreviewCacheEntry, f as PreviewRenderContext, g as PreviewRenderPhase, h as PreviewRenderResult, i as PreviewRendererDefinition, j as PreviewRendererMode, k as
|
|
3
|
+
import { O as OwoMarkPreviewEngineOptions, a as OwoMarkPreviewEngine, P as PreviewRendererRegistry, b as PreviewTaskScheduler } from './types-D4TVpyP7.js';
|
|
4
|
+
export { c as PreviewBlockMetadata, d as PreviewBlockRenderer, e as PreviewCacheEntry, f as PreviewRenderContext, g as PreviewRenderPhase, h as PreviewRenderResult, i as PreviewRendererDefinition, j as PreviewRendererMode, k as PreviewRendererRegistryLookup, l as PreviewRendererTarget, m as PreviewStrategy, n as PreviewTaskPriority } from './types-D4TVpyP7.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Three-layer view engine for OwoMark.
|
|
@@ -27,9 +27,8 @@ declare function createViewEngine(options: ViewEngineOptions): OwoMarkViewEngine
|
|
|
27
27
|
/**
|
|
28
28
|
* View engine for OwoMark.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* Public API:
|
|
31
31
|
* - createOwoMarkView(core, element): Three-layer sovereign view engine
|
|
32
|
-
* - createOwoMarkVanillaEditor(): Legacy standalone editor (backward compat)
|
|
33
32
|
*/
|
|
34
33
|
|
|
35
34
|
type OwoMarkView = OwoMarkViewEngine;
|
|
@@ -41,11 +40,6 @@ type OwoMarkView = OwoMarkViewEngine;
|
|
|
41
40
|
* const view = createOwoMarkView(core, element);
|
|
42
41
|
*/
|
|
43
42
|
declare function createOwoMarkView(core: OwoMarkCore, element: HTMLElement): OwoMarkView;
|
|
44
|
-
/**
|
|
45
|
-
* Create a standalone editor (creates its own Core internally).
|
|
46
|
-
* Preserved for backward compatibility with vanilla adapter consumers.
|
|
47
|
-
*/
|
|
48
|
-
declare function createOwoMarkVanillaEditor(): OwoMarkEditorInstance;
|
|
49
43
|
|
|
50
44
|
/**
|
|
51
45
|
* OwoMark Preview Engine factory.
|
|
@@ -76,6 +70,18 @@ declare function createRendererRegistry(): PreviewRendererRegistry;
|
|
|
76
70
|
*/
|
|
77
71
|
declare function renderBlockDefault(block: PreviewBlock): string;
|
|
78
72
|
|
|
73
|
+
type CardsFamilyPreviewBlock = PreviewBlock & {
|
|
74
|
+
kind: 'custom';
|
|
75
|
+
attributes: CardsFamilyAttributes & {
|
|
76
|
+
customBlockKey: typeof CARDS_FAMILY_CUSTOM_BLOCK_KEY;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
declare function isCardsFamilyPreviewBlock(block: PreviewBlock): block is CardsFamilyPreviewBlock;
|
|
80
|
+
declare function renderCardsFamilyPreviewBlock(block: PreviewBlock): string;
|
|
81
|
+
|
|
82
|
+
declare function isSideAnnotationPreviewBlock(block: PreviewBlock): boolean;
|
|
83
|
+
declare function renderSideAnnotationPreviewBlock(block: PreviewBlock): string;
|
|
84
|
+
|
|
79
85
|
declare function createPreviewTaskScheduler(options?: {
|
|
80
86
|
poolSize?: number;
|
|
81
87
|
onCrash?: () => void;
|
|
@@ -169,4 +175,4 @@ declare const THEME_DARK_CLASS = "owo-theme-dark";
|
|
|
169
175
|
type OwoMarkThemeName = 'light' | 'dark' | string;
|
|
170
176
|
declare function getThemeClassName(theme: OwoMarkThemeName): string;
|
|
171
177
|
|
|
172
|
-
export { OwoMarkPreviewEngine, OwoMarkPreviewEngineOptions, type OwoMarkThemeName, type OwoMarkView, type OwoMarkViewEngine, PreviewDomPatcher, PreviewRendererRegistry, PreviewTaskScheduler, SideAnnotationPositioner, type SkeletonOptions, THEME_DARK_CLASS, THEME_LIGHT_CLASS, type ViewEngineOptions, createOwoMarkPreviewEngine,
|
|
178
|
+
export { OwoMarkPreviewEngine, OwoMarkPreviewEngineOptions, type OwoMarkThemeName, type OwoMarkView, type OwoMarkViewEngine, PreviewDomPatcher, PreviewRendererRegistry, PreviewTaskScheduler, SideAnnotationPositioner, type SkeletonOptions, THEME_DARK_CLASS, THEME_LIGHT_CLASS, type ViewEngineOptions, createOwoMarkPreviewEngine, createOwoMarkView, createPreviewTaskScheduler, createRendererRegistry, createSkeletonHtml, createViewEngine, ensureSkeletonStyles, getThemeClassName, isCardsFamilyPreviewBlock, isSideAnnotationPreviewBlock, renderBlockDefault, renderCardsFamilyPreviewBlock, renderSideAnnotationPreviewBlock };
|