@blockslides/core 0.1.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.
@@ -0,0 +1,23 @@
1
+ type Attributes = Record<string, any>;
2
+ type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray;
3
+ /**
4
+ * Better describes the output of a `renderHTML` function in prosemirror
5
+ * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec
6
+ */
7
+ type DOMOutputSpecArray = [string] | [string, Attributes] | [string, 0] | [string, Attributes, 0] | [string, Attributes, DOMOutputSpecArray | 0] | [string, DOMOutputSpecArray];
8
+ declare namespace JSX {
9
+ type Element = DOMOutputSpecArray;
10
+ interface IntrinsicElements {
11
+ [key: string]: any;
12
+ }
13
+ interface ElementChildrenAttribute {
14
+ children: unknown;
15
+ }
16
+ }
17
+ type JSXRenderer = (tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement), props?: Attributes, ...children: JSXRenderer[]) => DOMOutputSpecArray | DOMOutputSpecElement;
18
+ declare function Fragment(props: {
19
+ children: JSXRenderer[];
20
+ }): JSXRenderer[];
21
+ declare const h: JSXRenderer;
22
+
23
+ export { type Attributes, type DOMOutputSpecArray, type DOMOutputSpecElement, Fragment, JSX, type JSXRenderer, h as createElement, h, h as jsx, h as jsxDEV, h as jsxs };
@@ -0,0 +1,23 @@
1
+ type Attributes = Record<string, any>;
2
+ type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray;
3
+ /**
4
+ * Better describes the output of a `renderHTML` function in prosemirror
5
+ * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec
6
+ */
7
+ type DOMOutputSpecArray = [string] | [string, Attributes] | [string, 0] | [string, Attributes, 0] | [string, Attributes, DOMOutputSpecArray | 0] | [string, DOMOutputSpecArray];
8
+ declare namespace JSX {
9
+ type Element = DOMOutputSpecArray;
10
+ interface IntrinsicElements {
11
+ [key: string]: any;
12
+ }
13
+ interface ElementChildrenAttribute {
14
+ children: unknown;
15
+ }
16
+ }
17
+ type JSXRenderer = (tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement), props?: Attributes, ...children: JSXRenderer[]) => DOMOutputSpecArray | DOMOutputSpecElement;
18
+ declare function Fragment(props: {
19
+ children: JSXRenderer[];
20
+ }): JSXRenderer[];
21
+ declare const h: JSXRenderer;
22
+
23
+ export { type Attributes, type DOMOutputSpecArray, type DOMOutputSpecElement, Fragment, JSX, type JSXRenderer, h as createElement, h, h as jsx, h as jsxDEV, h as jsxs };
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/jsx-runtime.ts
21
+ var jsx_runtime_exports = {};
22
+ __export(jsx_runtime_exports, {
23
+ Fragment: () => Fragment,
24
+ createElement: () => h,
25
+ h: () => h,
26
+ jsx: () => h,
27
+ jsxDEV: () => h,
28
+ jsxs: () => h
29
+ });
30
+ module.exports = __toCommonJS(jsx_runtime_exports);
31
+ function Fragment(props) {
32
+ return props.children;
33
+ }
34
+ var h = (tag, attributes) => {
35
+ if (tag === "slot") {
36
+ return 0;
37
+ }
38
+ if (tag instanceof Function) {
39
+ return tag(attributes);
40
+ }
41
+ const { children, ...rest } = attributes != null ? attributes : {};
42
+ if (tag === "svg") {
43
+ throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
44
+ }
45
+ return [tag, rest, children];
46
+ };
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ Fragment,
50
+ createElement,
51
+ h,
52
+ jsx,
53
+ jsxDEV,
54
+ jsxs
55
+ });
56
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/jsx-runtime.ts"],"sourcesContent":["export type Attributes = Record<string, any>\n\nexport type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray\n/**\n * Better describes the output of a `renderHTML` function in prosemirror\n * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec\n */\nexport type DOMOutputSpecArray =\n | [string]\n | [string, Attributes]\n | [string, 0]\n | [string, Attributes, 0]\n | [string, Attributes, DOMOutputSpecArray | 0]\n | [string, DOMOutputSpecArray]\n\n// JSX types for AA's JSX runtime\n// These types only apply when using @jsxImportSource @blockslides/core\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace JSX {\n export type Element = DOMOutputSpecArray\n export interface IntrinsicElements {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n }\n export interface ElementChildrenAttribute {\n children: unknown\n }\n}\n\nexport type JSXRenderer = (\n tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement),\n props?: Attributes,\n ...children: JSXRenderer[]\n) => DOMOutputSpecArray | DOMOutputSpecElement\n\nexport function Fragment(props: { children: JSXRenderer[] }) {\n return props.children\n}\n\nexport const h: JSXRenderer = (tag, attributes) => {\n // Treat the slot tag as the Prosemirror hole to render content into\n if (tag === 'slot') {\n return 0\n }\n\n // If the tag is a function, call it with the props\n if (tag instanceof Function) {\n return tag(attributes)\n }\n\n const { children, ...rest } = attributes ?? {}\n\n if (tag === 'svg') {\n throw new Error('SVG elements are not supported in the JSX syntax, use the array syntax instead')\n }\n\n // Otherwise, return the tag, attributes, and children\n return [tag, rest, children]\n}\n\n// See\n// https://esbuild.github.io/api/#jsx-import-source\n// https://www.typescriptlang.org/tsconfig/#jsxImportSource\n\nexport { h as createElement, h as jsx, h as jsxDEV, h as jsxs }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCO,SAAS,SAAS,OAAoC;AAC3D,SAAO,MAAM;AACf;AAEO,IAAM,IAAiB,CAAC,KAAK,eAAe;AAEjD,MAAI,QAAQ,QAAQ;AAClB,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,UAAU;AAC3B,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI,kCAAc,CAAC;AAE7C,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,gFAAgF;AAAA,EAClG;AAGA,SAAO,CAAC,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
@@ -0,0 +1,26 @@
1
+ // src/jsx-runtime.ts
2
+ function Fragment(props) {
3
+ return props.children;
4
+ }
5
+ var h = (tag, attributes) => {
6
+ if (tag === "slot") {
7
+ return 0;
8
+ }
9
+ if (tag instanceof Function) {
10
+ return tag(attributes);
11
+ }
12
+ const { children, ...rest } = attributes != null ? attributes : {};
13
+ if (tag === "svg") {
14
+ throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
15
+ }
16
+ return [tag, rest, children];
17
+ };
18
+ export {
19
+ Fragment,
20
+ h as createElement,
21
+ h,
22
+ h as jsx,
23
+ h as jsxDEV,
24
+ h as jsxs
25
+ };
26
+ //# sourceMappingURL=jsx-runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/jsx-runtime.ts"],"sourcesContent":["export type Attributes = Record<string, any>\n\nexport type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray\n/**\n * Better describes the output of a `renderHTML` function in prosemirror\n * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec\n */\nexport type DOMOutputSpecArray =\n | [string]\n | [string, Attributes]\n | [string, 0]\n | [string, Attributes, 0]\n | [string, Attributes, DOMOutputSpecArray | 0]\n | [string, DOMOutputSpecArray]\n\n// JSX types for AA's JSX runtime\n// These types only apply when using @jsxImportSource @blockslides/core\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace JSX {\n export type Element = DOMOutputSpecArray\n export interface IntrinsicElements {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n }\n export interface ElementChildrenAttribute {\n children: unknown\n }\n}\n\nexport type JSXRenderer = (\n tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement),\n props?: Attributes,\n ...children: JSXRenderer[]\n) => DOMOutputSpecArray | DOMOutputSpecElement\n\nexport function Fragment(props: { children: JSXRenderer[] }) {\n return props.children\n}\n\nexport const h: JSXRenderer = (tag, attributes) => {\n // Treat the slot tag as the Prosemirror hole to render content into\n if (tag === 'slot') {\n return 0\n }\n\n // If the tag is a function, call it with the props\n if (tag instanceof Function) {\n return tag(attributes)\n }\n\n const { children, ...rest } = attributes ?? {}\n\n if (tag === 'svg') {\n throw new Error('SVG elements are not supported in the JSX syntax, use the array syntax instead')\n }\n\n // Otherwise, return the tag, attributes, and children\n return [tag, rest, children]\n}\n\n// See\n// https://esbuild.github.io/api/#jsx-import-source\n// https://www.typescriptlang.org/tsconfig/#jsxImportSource\n\nexport { h as createElement, h as jsx, h as jsxDEV, h as jsxs }\n"],"mappings":";AAmCO,SAAS,SAAS,OAAoC;AAC3D,SAAO,MAAM;AACf;AAEO,IAAM,IAAiB,CAAC,KAAK,eAAe;AAEjD,MAAI,QAAQ,QAAQ;AAClB,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,UAAU;AAC3B,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI,kCAAc,CAAC;AAE7C,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,gFAAgF;AAAA,EAClG;AAGA,SAAO,CAAC,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@blockslides/core",
3
+ "version": "0.1.0",
4
+ "description": "Core ProseMirror-based slide editor with essential plugins",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./jsx-runtime": {
15
+ "import": "./dist/jsx-runtime/jsx-runtime.mjs",
16
+ "require": "./dist/jsx-runtime/jsx-runtime.js",
17
+ "types": "./dist/jsx-runtime/jsx-runtime.d.ts"
18
+ },
19
+ "./jsx-dev-runtime": {
20
+ "import": "./dist/jsx-dev-runtime/jsx-dev-runtime.mjs",
21
+ "require": "./dist/jsx-dev-runtime/jsx-dev-runtime.js",
22
+ "types": "./dist/jsx-dev-runtime/jsx-dev-runtime.d.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "dependencies": {
29
+ "prosemirror-commands": "^1.7.1",
30
+ "prosemirror-history": "^1.4.1",
31
+ "prosemirror-inputrules": "^1.4.0",
32
+ "prosemirror-keymap": "^1.2.3",
33
+ "prosemirror-model": "^1.25.3",
34
+ "prosemirror-schema-basic": "^1.2.4",
35
+ "prosemirror-state": "^1.4.3",
36
+ "prosemirror-view": "^1.41.2",
37
+ "@blockslides/pm": "0.1.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/jest": "^30.0.0",
41
+ "@types/jsdom": "^27.0.0",
42
+ "jest": "^30.2.0",
43
+ "jest-environment-jsdom": "^30.2.0",
44
+ "jsdom": "^27.0.0",
45
+ "prosemirror-test-builder": "^1.1.1",
46
+ "ts-jest": "^29.4.5",
47
+ "tsup": "^8.0.0",
48
+ "typescript": "^5.0.0"
49
+ },
50
+ "keywords": [
51
+ "prosemirror",
52
+ "editor",
53
+ "slides",
54
+ "presentation"
55
+ ],
56
+ "author": "keivanmojmali",
57
+ "license": "MIT",
58
+ "scripts": {
59
+ "build": "tsup",
60
+ "dev": "tsup --watch",
61
+ "test": "jest",
62
+ "test:watch": "jest --watch",
63
+ "test:coverage": "jest --coverage"
64
+ }
65
+ }