@particle-academy/fancy-slides 0.1.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 +99 -0
- package/dist/chart-host-VIGM3J5Q.js +11 -0
- package/dist/chart-host-VIGM3J5Q.js.map +1 -0
- package/dist/code-host-IYT6QDLA.js +21 -0
- package/dist/code-host-IYT6QDLA.js.map +1 -0
- package/dist/embed-host-ZECUEAOU.js +18 -0
- package/dist/embed-host-ZECUEAOU.js.map +1 -0
- package/dist/index.cjs +1787 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +1761 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.cjs +135 -0
- package/dist/registry.cjs.map +1 -0
- package/dist/registry.js +44 -0
- package/dist/registry.js.map +1 -0
- package/dist/styles.css +24 -0
- package/dist/styles.css.map +1 -0
- package/dist/table-host-LWPOQHTL.js +19 -0
- package/dist/table-host-LWPOQHTL.js.map +1 -0
- package/package.json +59 -0
package/dist/registry.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { lazy, Suspense } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/registry/index.tsx
|
|
5
|
+
var ChartHost = lazy(() => import('./chart-host-VIGM3J5Q.js'));
|
|
6
|
+
var CodeHost = lazy(() => import('./code-host-IYT6QDLA.js'));
|
|
7
|
+
var TableHost = lazy(() => import('./table-host-LWPOQHTL.js'));
|
|
8
|
+
var EmbedHost = lazy(() => import('./embed-host-ZECUEAOU.js'));
|
|
9
|
+
var Loading = ({ label }) => /* @__PURE__ */ jsxs(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
style: {
|
|
13
|
+
display: "grid",
|
|
14
|
+
placeItems: "center",
|
|
15
|
+
width: "100%",
|
|
16
|
+
height: "100%",
|
|
17
|
+
color: "rgba(0,0,0,0.4)",
|
|
18
|
+
fontSize: 12,
|
|
19
|
+
fontFamily: "ui-sans-serif, system-ui, sans-serif"
|
|
20
|
+
},
|
|
21
|
+
children: [
|
|
22
|
+
label,
|
|
23
|
+
"\u2026"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
function defaultElementRegistry(element, slideWidthPx) {
|
|
28
|
+
switch (element.type) {
|
|
29
|
+
case "chart":
|
|
30
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loading, { label: "Loading chart" }), children: /* @__PURE__ */ jsx(ChartHost, { element, slideWidthPx }) });
|
|
31
|
+
case "code":
|
|
32
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loading, { label: "Loading code" }), children: /* @__PURE__ */ jsx(CodeHost, { element }) });
|
|
33
|
+
case "table":
|
|
34
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loading, { label: "Loading table" }), children: /* @__PURE__ */ jsx(TableHost, { element }) });
|
|
35
|
+
case "embed":
|
|
36
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loading, { label: "Loading embed" }), children: /* @__PURE__ */ jsx(EmbedHost, { element }) });
|
|
37
|
+
default:
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { defaultElementRegistry };
|
|
43
|
+
//# sourceMappingURL=registry.js.map
|
|
44
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/registry/index.tsx"],"names":[],"mappings":";;;;AAkBA,IAAM,SAAA,GAAY,IAAA,CAAK,MAAM,OAAO,0BAAgC,CAAC,CAAA;AACrE,IAAM,QAAA,GAAW,IAAA,CAAK,MAAM,OAAO,yBAA+B,CAAC,CAAA;AACnE,IAAM,SAAA,GAAY,IAAA,CAAK,MAAM,OAAO,0BAAgC,CAAC,CAAA;AACrE,IAAM,SAAA,GAAY,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AER,KAAK,OAAA;AACD,MAAA,uBACI,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAM,eAAA,EAAgB,CAAA,EAC/C,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,OAAA,EAAkC,CAAA,EACjD,CAAA;AAAA,IAER;AACI,MAAA,OAAO,MAAA;AAAA;AAEnB","file":"registry.js","sourcesContent":["/**\n * Default element registry. Wires up the element types fancy-slides doesn't\n * render natively (chart / code / table / embed) by composing the other\n * fancy packages as optional peer deps.\n *\n * Hosts opt into this by importing from the `/registry` subpath:\n *\n * import { defaultElementRegistry } from \"@particle-academy/fancy-slides/registry\";\n * <DeckEditor renderElement={defaultElementRegistry} … />\n *\n * Keeping it behind a subpath means consumers who only render decks with\n * built-in element types (text / image / shape) never pull fancy-echarts,\n * fancy-code, or react-fancy Table into their bundle.\n */\n\nimport { lazy, Suspense } from \"react\";\nimport type { ChartElement, CodeElement, SlideElement, EmbedElement, TableElement } from \"../types\";\n\nconst ChartHost = lazy(() => import(\"./element-renderers/chart-host\"));\nconst CodeHost = lazy(() => import(\"./element-renderers/code-host\"));\nconst TableHost = lazy(() => import(\"./element-renderers/table-host\"));\nconst EmbedHost = lazy(() => import(\"./element-renderers/embed-host\"));\n\nconst Loading = ({ label }: { label: string }) => (\n <div\n style={{\n display: \"grid\",\n placeItems: \"center\",\n width: \"100%\",\n height: \"100%\",\n color: \"rgba(0,0,0,0.4)\",\n fontSize: 12,\n fontFamily: \"ui-sans-serif, system-ui, sans-serif\",\n }}\n >\n {label}…\n </div>\n);\n\n/**\n * Renderer signature compatible with `Slide`'s `renderElement` prop. Returns\n * `undefined` for element types fancy-slides handles itself, so the call\n * site falls back to the built-in renderer.\n */\nexport function defaultElementRegistry(element: SlideElement, slideWidthPx: number) {\n switch (element.type) {\n case \"chart\":\n return (\n <Suspense fallback={<Loading label=\"Loading chart\" />}>\n <ChartHost element={element as ChartElement} slideWidthPx={slideWidthPx} />\n </Suspense>\n );\n case \"code\":\n return (\n <Suspense fallback={<Loading label=\"Loading code\" />}>\n <CodeHost element={element as CodeElement} />\n </Suspense>\n );\n case \"table\":\n return (\n <Suspense fallback={<Loading label=\"Loading table\" />}>\n <TableHost element={element as TableElement} />\n </Suspense>\n );\n case \"embed\":\n return (\n <Suspense fallback={<Loading label=\"Loading embed\" />}>\n <EmbedHost element={element as EmbedElement} />\n </Suspense>\n );\n default:\n return undefined;\n }\n}\n"]}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* src/styles.css */
|
|
2
|
+
.fs-slide,
|
|
3
|
+
.fs-viewer,
|
|
4
|
+
.fs-thumbnail {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
.fs-slide *,
|
|
8
|
+
.fs-slide *::before,
|
|
9
|
+
.fs-slide *::after {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
.fs-viewer:focus {
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
[data-fancy-slides-element] {
|
|
16
|
+
user-select: none;
|
|
17
|
+
}
|
|
18
|
+
[data-fancy-slides-element] textarea {
|
|
19
|
+
font-family: inherit;
|
|
20
|
+
font-size: inherit;
|
|
21
|
+
color: inherit;
|
|
22
|
+
user-select: text;
|
|
23
|
+
}
|
|
24
|
+
/*# sourceMappingURL=styles.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/styles.css"],"sourcesContent":["/* fancy-slides — scoped baseline. Most styling is inline so themes can\n * cascade resolution-independently; this file only provides the resets the\n * package can't inline. */\n\n.fs-slide,\n.fs-viewer,\n.fs-thumbnail {\n box-sizing: border-box;\n}\n\n.fs-slide *,\n.fs-slide *::before,\n.fs-slide *::after {\n box-sizing: border-box;\n}\n\n.fs-viewer:focus {\n outline: none;\n}\n\n/* Selection focus ring on elements inside the editor. */\n[data-fancy-slides-element] {\n user-select: none;\n}\n\n[data-fancy-slides-element] textarea {\n font-family: inherit;\n font-size: inherit;\n color: inherit;\n user-select: text;\n}\n"],"mappings":";AAIA,CAAC;AACD,CAAC;AACD,CAAC;AACC,cAAY;AACd;AAEA,CANC,SAMS;AACV,CAPC,SAOS,CAAC;AACX,CARC,SAQS,CAAC;AACT,cAAY;AACd;AAEA,CAXC,SAWS;AACR,WAAS;AACX;AAGA,CAAC;AACC,eAAa;AACf;AAEA,CAAC,2BAA2B;AAC1B,eAAa;AACb,aAAW;AACX,SAAO;AACP,eAAa;AACf;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Table } from '@particle-academy/react-fancy';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/registry/element-renderers/table-host.tsx
|
|
5
|
+
function TableHost({ element }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxs(Table, { className: "w-full", children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Table.Head, { children: /* @__PURE__ */ jsx(Table.Row, { children: element.columns.map((c) => /* @__PURE__ */ jsx(Table.Cell, { header: true, children: c.label }, c.key)) }) }),
|
|
8
|
+
/* @__PURE__ */ jsx(Table.Body, { children: element.rows.map((row, i) => /* @__PURE__ */ jsx(Table.Row, { children: element.columns.map((c) => /* @__PURE__ */ jsx(Table.Cell, { children: formatCell(row[c.key]) }, c.key)) }, i)) })
|
|
9
|
+
] }) });
|
|
10
|
+
}
|
|
11
|
+
function formatCell(v) {
|
|
12
|
+
if (v == null) return "";
|
|
13
|
+
if (typeof v === "object") return JSON.stringify(v);
|
|
14
|
+
return String(v);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { TableHost as default };
|
|
18
|
+
//# sourceMappingURL=table-host-LWPOQHTL.js.map
|
|
19
|
+
//# sourceMappingURL=table-host-LWPOQHTL.js.map
|
|
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AAA;AAClD,EAAA,OAAO,OAAO,CAAC,CAAA;AACnB","file":"table-host-LWPOQHTL.js","sourcesContent":["import { Table } from \"@particle-academy/react-fancy\";\nimport type { TableElement } from \"../../types\";\n\nexport default function TableHost({ element }: { element: TableElement }) {\n return (\n <div style={{ width: \"100%\", height: \"100%\", overflow: \"auto\" }}>\n <Table className=\"w-full\">\n <Table.Head>\n <Table.Row>\n {element.columns.map((c) => (\n <Table.Cell key={c.key} header>\n {c.label}\n </Table.Cell>\n ))}\n </Table.Row>\n </Table.Head>\n <Table.Body>\n {element.rows.map((row, i) => (\n <Table.Row key={i}>\n {element.columns.map((c) => (\n <Table.Cell key={c.key}>{formatCell(row[c.key])}</Table.Cell>\n ))}\n </Table.Row>\n ))}\n </Table.Body>\n </Table>\n </div>\n );\n}\n\nfunction formatCell(v: unknown): string {\n if (v == null) return \"\";\n if (typeof v === \"object\") return JSON.stringify(v);\n return String(v);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@particle-academy/fancy-slides",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Presentation editor + web viewer for the fancy UI set — Google-Slides-style deck authoring with a JSON-friendly schema, full keyboard-driven viewer, and an agent bridge so LLMs can compose decks directly.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Particle-Academy/fancy-slides.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Particle-Academy/fancy-slides#readme",
|
|
10
|
+
"bugs": "https://github.com/Particle-Academy/fancy-slides/issues",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./registry": {
|
|
20
|
+
"import": "./dist/registry.js",
|
|
21
|
+
"require": "./dist/registry.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./styles.css": "./dist/styles.css"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "docs", "README.md"],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup",
|
|
28
|
+
"dev": "tsup --watch",
|
|
29
|
+
"lint": "tsc --noEmit",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"prepublishOnly": "tsup"
|
|
32
|
+
},
|
|
33
|
+
"keywords": ["react", "slides", "presentation", "slideshow", "deck", "agent", "fancy", "human-plus"],
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
37
|
+
"@particle-academy/react-fancy": "^3.0.0",
|
|
38
|
+
"@particle-academy/fancy-echarts": "^3.0.0",
|
|
39
|
+
"@particle-academy/fancy-code": "^0.4.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"@particle-academy/fancy-echarts": { "optional": true },
|
|
43
|
+
"@particle-academy/fancy-code": { "optional": true }
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@particle-academy/fancy-code": "^0.4.0",
|
|
47
|
+
"@particle-academy/fancy-echarts": "^3.0.0",
|
|
48
|
+
"@particle-academy/react-fancy": "^3.0.0",
|
|
49
|
+
"@types/react": "^19.0.0",
|
|
50
|
+
"@types/react-dom": "^19.0.0",
|
|
51
|
+
"react": "^19.0.0",
|
|
52
|
+
"react-dom": "^19.0.0",
|
|
53
|
+
"tsup": "^8.5.0",
|
|
54
|
+
"typescript": "^5.8.0"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": { "access": "public" },
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"sideEffects": ["**/*.css"]
|
|
59
|
+
}
|