@pretextbook/web-editor 0.0.2 → 0.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/dist/App.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import 'primereact/resources/themes/lara-light-blue/theme.css';
2
+ import 'primereact/resources/primereact.min.css';
3
+ import 'primeicons/primeicons.css';
4
+ import 'primeflex/primeflex.css';
5
+ import './App.css';
6
+ declare function App(): import("react/jsx-runtime").JSX.Element;
7
+ export default App;
@@ -0,0 +1,4 @@
1
+ import { Editor } from "@tiptap/react";
2
+ export declare const PtxBubbleMenu: ({ editor }: {
3
+ editor: Editor;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ interface CodeEditorProps {
2
+ content: string;
3
+ onChange: (value: string | undefined) => void;
4
+ }
5
+ declare const CodeEditor: ({ content, onChange }: CodeEditorProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default CodeEditor;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './CodeEditorMenu.css';
3
+ interface CodeEditorMenuProps {
4
+ content: string;
5
+ onContentChange: (newContent: string) => void;
6
+ onUndo: () => void;
7
+ onRedo: () => void;
8
+ canUndo: boolean;
9
+ canRedo: boolean;
10
+ }
11
+ declare const CodeEditorMenu: React.FC<CodeEditorMenuProps>;
12
+ export default CodeEditorMenu;
@@ -0,0 +1,12 @@
1
+ export interface editorProps {
2
+ content: string;
3
+ onContentChange: (value: string | undefined) => void;
4
+ title?: string;
5
+ onTitleChange?: (value: string) => void;
6
+ onSaveButton?: () => void;
7
+ saveButtonLabel?: string;
8
+ onCancelButton?: () => void;
9
+ cancelButtonLabel?: string;
10
+ }
11
+ declare const Editors: (props: editorProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default Editors;
@@ -0,0 +1,4 @@
1
+ import { Editor } from "@tiptap/react";
2
+ export declare const PtxFloatingMenu: ({ editor }: {
3
+ editor: Editor;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ interface FullPreviewProps {
2
+ content: string;
3
+ }
4
+ declare const FullPreview: ({ content }: FullPreviewProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default FullPreview;
@@ -0,0 +1,12 @@
1
+ export interface MenuBarProps {
2
+ isChecked: boolean;
3
+ onChange: () => void;
4
+ title?: string;
5
+ onTitleChange?: (value: string) => void;
6
+ onSaveButton?: () => void;
7
+ saveButtonLabel?: string;
8
+ onCancelButton?: () => void;
9
+ cancelButtonLabel?: string;
10
+ }
11
+ declare const MenuBar: (props: MenuBarProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default MenuBar;
@@ -0,0 +1,3 @@
1
+ declare const TheoremLikeComponent: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ProofComponent: () => import("react/jsx-runtime").JSX.Element;
3
+ export { TheoremLikeComponent, ProofComponent };
@@ -0,0 +1,4 @@
1
+ import { Editor } from "@tiptap/react";
2
+ export declare const MenuBar: ({ editor }: {
3
+ editor: Editor;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import "katex/dist/katex.min.css";
2
+ import "../styles.scss";
3
+ interface VisualEditorProps {
4
+ content: string;
5
+ onChange: (html: string) => void;
6
+ }
7
+ interface VisualEditorProps {
8
+ content: string;
9
+ onChange: (html: string) => void;
10
+ }
11
+ declare const VisualEditor: ({ content, onChange }: VisualEditorProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default VisualEditor;
@@ -0,0 +1,3 @@
1
+ declare const defaultContent: string;
2
+ declare const simpleContent: string;
3
+ export { defaultContent, simpleContent };
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const AxiomLike: Extension<any, any>;
3
+ export default AxiomLike;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const Blocks: Extension<any, any>;
3
+ export default Blocks;
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare const Definition: Node<any, any>;
3
+ export default Definition;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const Divisions: Extension<any, any>;
3
+ export default Divisions;
@@ -0,0 +1,7 @@
1
+ import { Node } from "@tiptap/core";
2
+ export declare const inputPTXRegex: RegExp;
3
+ export declare const pastePTXRegex: RegExp;
4
+ export declare const inputMDRegex: RegExp;
5
+ export declare const inputRegex: RegExp;
6
+ declare const Emphasis: Node<any, any>;
7
+ export default Emphasis;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const ExampleLike: Extension<any, any>;
3
+ export default ExampleLike;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const Inline: Extension<any, any>;
3
+ export default Inline;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const KeyboardCommands: Extension<any, any>;
3
+ export default KeyboardCommands;
@@ -0,0 +1,5 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare const MathInline: Node<any, any>;
3
+ declare const MathEquation: Node<any, any>;
4
+ declare const MathDisplay: Node<any, any>;
5
+ export { MathInline, MathEquation, MathDisplay };
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare const RawPtx: Node<any, any>;
3
+ export default RawPtx;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const RemarkLike: Extension<any, any>;
3
+ export default RemarkLike;
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare const Statement: Node<any, any>;
3
+ export default Statement;
@@ -0,0 +1,3 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare const TheoremLike: Extension<any, any>;
3
+ export default TheoremLike;
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare const Title: Node<any, any>;
3
+ export default Title;
@@ -0,0 +1,3 @@
1
+ import { Mark } from "@tiptap/core";
2
+ declare const UnknownMark: Mark<any, any>;
3
+ export default UnknownMark;
@@ -0,0 +1,42 @@
1
+ interface CursorPosition {
2
+ pos: () => number;
3
+ depth: () => number;
4
+ inTextNode: () => boolean;
5
+ prevNodeIsText: () => boolean;
6
+ nextNodeIsText: () => boolean;
7
+ parentType: () => string;
8
+ anchor: () => any;
9
+ nextNodeSize: () => number;
10
+ prevNodeSize: () => number;
11
+ }
12
+ interface Editor {
13
+ $pos: (pos: number) => any;
14
+ state: {
15
+ selection: {
16
+ $anchor: {
17
+ pos: number;
18
+ depth: number;
19
+ parent: {
20
+ firstChild: {
21
+ isText: boolean;
22
+ } | null;
23
+ type: {
24
+ name: string;
25
+ };
26
+ };
27
+ nodeBefore: {
28
+ isText: boolean;
29
+ nodeSize: number;
30
+ } | null;
31
+ nodeAfter: {
32
+ type: {
33
+ name: string;
34
+ };
35
+ nodeSize: number;
36
+ } | null;
37
+ };
38
+ };
39
+ };
40
+ }
41
+ export declare const getCursorPos: (editor: Editor) => CursorPosition;
42
+ export {};
@@ -0,0 +1,5 @@
1
+ export { default as Editors } from './components/Editors';
2
+ export type { editorProps } from './components/Editors';
3
+ export { default as CodeEditor } from './components/CodeEditor';
4
+ export { default as VisualEditor } from './components/VisualEditor';
5
+ export { default as FullPreview } from './components/FullPreview';
@@ -0,0 +1,2 @@
1
+ declare function json2ptx(json: any): string;
2
+ export { json2ptx };
@@ -0,0 +1 @@
1
+ export declare const KNOWN_TAGS: string[];
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1,6 @@
1
+ export declare const setPtxSource: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "ptxSource/setPtxSource">;
2
+ declare const _default: import("redux").Reducer<{
3
+ value: string;
4
+ editor: null;
5
+ }>;
6
+ export default _default;
@@ -0,0 +1,14 @@
1
+ export declare function cleanPtx(origXml: string): string;
2
+ export declare function ptxToJson(xml: string): string;
3
+ export declare function blockAttributes(): {
4
+ label: {
5
+ parseHTML: (element: HTMLElement) => string | null;
6
+ };
7
+ "xml:id": {
8
+ parseHTML: (element: HTMLElement) => string | null;
9
+ };
10
+ component: {
11
+ parseHTML: (element: HTMLElement) => string | null;
12
+ };
13
+ };
14
+ export declare function generateInputRules(prefix: string, nodeType: any): import("@tiptap/core").InputRule[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretextbook/web-editor",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "A web-based editor for PreTeXt documents, with simple preview functionality",
6
6
  "keywords": [
@@ -27,8 +27,11 @@
27
27
  "types": "./dist/index.d.ts",
28
28
  "import": "./dist/index.es.js",
29
29
  "require": "./dist/index.js"
30
- }
30
+ },
31
+ "./dist/web-editor.css": "./dist/web-editor.css",
32
+ "./web-editor.css": "./dist/web-editor.css"
31
33
  },
34
+ "style": "./dist/web-editor.css",
32
35
  "files": [
33
36
  "dist"
34
37
  ],
@@ -38,7 +41,7 @@
38
41
  },
39
42
  "scripts": {
40
43
  "dev": "vite",
41
- "build": "tsc -b && vite build --mode lib",
44
+ "build": "vite build --mode lib && tsc -p tsconfig.build.json",
42
45
  "build:demo": "tsc -b && vite build",
43
46
  "lint": "eslint .",
44
47
  "preview": "vite preview"