pagepilot-visual-editor 1.0.2 → 1.0.3
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pagepilot-visual-editor
|
|
2
2
|
|
|
3
3
|
A standalone, prop-driven **React page-type visual editor**. Drop
|
|
4
4
|
`<PagePilotEditor />` into your host application, pass the host record through
|
|
@@ -15,11 +15,11 @@ everything else.
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install
|
|
18
|
+
npm install pagepilot-visual-editor
|
|
19
19
|
# or
|
|
20
|
-
pnpm add
|
|
20
|
+
pnpm add pagepilot-visual-editor
|
|
21
21
|
# or
|
|
22
|
-
yarn add
|
|
22
|
+
yarn add pagepilot-visual-editor
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Peer dependencies (your host should provide these):
|
|
@@ -52,7 +52,7 @@ npm install zod
|
|
|
52
52
|
## Quick start
|
|
53
53
|
|
|
54
54
|
```tsx
|
|
55
|
-
import { PagePilotEditor } from "
|
|
55
|
+
import { PagePilotEditor } from "pagepilot-visual-editor";
|
|
56
56
|
|
|
57
57
|
export default function PageEditorScreen() {
|
|
58
58
|
const [record, setRecord] = useState(initialRecord);
|
|
@@ -394,7 +394,7 @@ import {
|
|
|
394
394
|
PagePilotEditor,
|
|
395
395
|
pagePilotEditorDarkTheme,
|
|
396
396
|
pagePilotEditorLightTheme,
|
|
397
|
-
} from "
|
|
397
|
+
} from "pagepilot-visual-editor";
|
|
398
398
|
|
|
399
399
|
// Built-in themes — these are full MUI Theme objects.
|
|
400
400
|
<PagePilotEditor mode="dark" />
|
|
@@ -443,7 +443,7 @@ Two ways:
|
|
|
443
443
|
import {
|
|
444
444
|
setPagePilotEditorTranslations,
|
|
445
445
|
resetPagePilotEditorTranslations,
|
|
446
|
-
} from "
|
|
446
|
+
} from "pagepilot-visual-editor";
|
|
447
447
|
|
|
448
448
|
setPagePilotEditorTranslations(myDict); // merges on top of defaults
|
|
449
449
|
resetPagePilotEditorTranslations(); // back to English defaults
|
|
@@ -479,7 +479,7 @@ Hide any of them via the `blocks` prop. Tile labels can be re-translated via `tr
|
|
|
479
479
|
The original Pagepilot `EditorContext` Zustand store is re-exported under the `EditorContext` namespace so advanced consumers can drive document state imperatively from outside the component:
|
|
480
480
|
|
|
481
481
|
```ts
|
|
482
|
-
import { EditorContext } from "
|
|
482
|
+
import { EditorContext } from "pagepilot-visual-editor";
|
|
483
483
|
|
|
484
484
|
EditorContext.setDocument({ root: ... });
|
|
485
485
|
EditorContext.resetDocument(myDoc);
|
|
@@ -490,7 +490,7 @@ EditorContext.editorStateStore; // raw Zustand store
|
|
|
490
490
|
The built-in Reader is also re-exported so you can render saved documents outside the editor:
|
|
491
491
|
|
|
492
492
|
```ts
|
|
493
|
-
import { Reader, renderToStaticMarkup } from "
|
|
493
|
+
import { Reader, renderToStaticMarkup } from "pagepilot-visual-editor";
|
|
494
494
|
|
|
495
495
|
const html = renderToStaticMarkup(myDoc, { rootBlockId: "root" });
|
|
496
496
|
```
|
|
@@ -501,26 +501,26 @@ const html = renderToStaticMarkup(myDoc, { rootBlockId: "root" });
|
|
|
501
501
|
|
|
502
502
|
```ts
|
|
503
503
|
// Component + imperative document setters
|
|
504
|
-
export { PagePilotEditor, setDocument, resetDocument } from "
|
|
504
|
+
export { PagePilotEditor, setDocument, resetDocument } from "pagepilot-visual-editor";
|
|
505
505
|
|
|
506
506
|
// Themes
|
|
507
|
-
export { pagePilotEditorDarkTheme, pagePilotEditorLightTheme } from "
|
|
507
|
+
export { pagePilotEditorDarkTheme, pagePilotEditorLightTheme } from "pagepilot-visual-editor";
|
|
508
508
|
|
|
509
509
|
// Translation helpers
|
|
510
510
|
export {
|
|
511
511
|
setPagePilotEditorTranslations,
|
|
512
512
|
resetPagePilotEditorTranslations,
|
|
513
|
-
} from "
|
|
513
|
+
} from "pagepilot-visual-editor";
|
|
514
514
|
|
|
515
515
|
// Reader / renderer
|
|
516
516
|
export {
|
|
517
517
|
Reader, ReaderBlock,
|
|
518
518
|
renderToStaticMarkup,
|
|
519
519
|
ReaderBlockSchema, ReaderDocumentSchema,
|
|
520
|
-
} from "
|
|
520
|
+
} from "pagepilot-visual-editor";
|
|
521
521
|
|
|
522
522
|
// Imperative store access
|
|
523
|
-
export * as EditorContext from "
|
|
523
|
+
export * as EditorContext from "pagepilot-visual-editor";
|
|
524
524
|
|
|
525
525
|
// Types
|
|
526
526
|
export type {
|
|
@@ -528,7 +528,7 @@ export type {
|
|
|
528
528
|
EditorPanelToggles, TopbarToggles,
|
|
529
529
|
BlockKey, BlockToggles,
|
|
530
530
|
TReaderBlock, TReaderDocument, TReaderBlockProps, TReaderProps,
|
|
531
|
-
} from "
|
|
531
|
+
} from "pagepilot-visual-editor";
|
|
532
532
|
```
|
|
533
533
|
|
|
534
534
|
---
|
|
@@ -5,7 +5,7 @@ declare const PreviewDialog: ({ previewDialogOpen, setPreviewDialogOpen, preview
|
|
|
5
5
|
setPreviewDialogOpen: (open: boolean) => void;
|
|
6
6
|
previewUrl: string | null;
|
|
7
7
|
/** Inline HTML — rendered via iframe `srcDoc`, used when there's no backend
|
|
8
|
-
* preview URL (e.g. the standalone
|
|
8
|
+
* preview URL (e.g. the standalone pagepilot-visual-editor package). */
|
|
9
9
|
previewHtml?: string | null;
|
|
10
10
|
pageType?: PageTypes | string;
|
|
11
11
|
onIntegrate?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagepilot-visual-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Standalone visual editor — drop <PagePilotEditor> into any React app and get Style/Layout/Inspect/Layers panels, drag-and-drop blocks, undo/redo, dirty-tracked save, multi-section pages, and light/dark themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|