@particle-academy/fancy-slides 0.8.0 → 0.9.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.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { h as Slide$1, o as Theme, j as SlideElement, D as Deck, d as DeckOp, g as ShapeKind, l as SlideTransition, i as SlideBackground, k as SlideLayout, E as ElementAnimation, m as TextElement, I as ImageElement, S as ShapeElement } from './types-9BbelJX1.cjs';
4
- export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, T as TableElement, n as TextStyle, p as ThemeColors, q as ThemeFonts, r as TransitionKind } from './types-9BbelJX1.cjs';
3
+ import { i as Slide$1, p as Theme, k as SlideElement, D as Deck, d as DeckOp, h as ShapeKind, m as SlideTransition, j as SlideBackground, l as SlideLayout, E as ElementAnimation, n as TextElement, I as ImageElement, g as ShapeElement } from './types-2yYMJPhi.cjs';
4
+ export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, S as SCHEMA_VERSION, T as TableElement, o as TextStyle, q as ThemeColors, r as ThemeFonts, s as TransitionKind } from './types-2yYMJPhi.cjs';
5
5
  import { EditorAction } from '@particle-academy/react-fancy';
6
6
 
7
7
  interface SlideProps {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { h as Slide$1, o as Theme, j as SlideElement, D as Deck, d as DeckOp, g as ShapeKind, l as SlideTransition, i as SlideBackground, k as SlideLayout, E as ElementAnimation, m as TextElement, I as ImageElement, S as ShapeElement } from './types-9BbelJX1.js';
4
- export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, T as TableElement, n as TextStyle, p as ThemeColors, q as ThemeFonts, r as TransitionKind } from './types-9BbelJX1.js';
3
+ import { i as Slide$1, p as Theme, k as SlideElement, D as Deck, d as DeckOp, h as ShapeKind, m as SlideTransition, j as SlideBackground, l as SlideLayout, E as ElementAnimation, n as TextElement, I as ImageElement, g as ShapeElement } from './types-2yYMJPhi.js';
4
+ export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, S as SCHEMA_VERSION, T as TableElement, o as TextStyle, q as ThemeColors, r as ThemeFonts, s as TransitionKind } from './types-2yYMJPhi.js';
5
5
  import { EditorAction } from '@particle-academy/react-fancy';
6
6
 
7
7
  interface SlideProps {
package/dist/index.js CHANGED
@@ -728,7 +728,18 @@ function SlideElementHost({
728
728
  touchAction: canMove ? "none" : void 0,
729
729
  ...buildAnimation ? buildEnterStyle(buildAnimation, buildDelay) : null
730
730
  };
731
- const inner = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx) ?? elementPlaceholder(element);
731
+ const rendered = renderInner({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal }) ?? renderElement?.(element, slideWidthPx) ?? elementPlaceholder(element);
732
+ const inner = element.href && !editing ? /* @__PURE__ */ jsx(
733
+ "a",
734
+ {
735
+ href: element.href,
736
+ target: "_blank",
737
+ rel: "noreferrer",
738
+ style: { display: "block", width: "100%", height: "100%", color: "inherit", textDecoration: "inherit" },
739
+ "data-fancy-slides-href": "",
740
+ children: rendered
741
+ }
742
+ ) : rendered;
732
743
  return /* @__PURE__ */ jsxs(
733
744
  "div",
734
745
  {
@@ -2033,7 +2044,7 @@ function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onS
2033
2044
  /* @__PURE__ */ jsxs(Tabs.Panels, { children: [
2034
2045
  /* @__PURE__ */ jsx(Tabs.Panel, { value: "style", children: /* @__PURE__ */ jsx(Card, { padding: "md", className: "!bg-white dark:!bg-zinc-950", children: /* @__PURE__ */ jsx(StyleSection, { element, onPatch }) }) }),
2035
2046
  /* @__PURE__ */ jsx(Tabs.Panel, { value: "build", children: /* @__PURE__ */ jsx(Card, { padding: "md", className: "!bg-white dark:!bg-zinc-950", children: /* @__PURE__ */ jsx(AnimateSection, { animation: element.animation, onSetAnimation, isText: element.type === "text" }) }) }),
2036
- /* @__PURE__ */ jsx(Tabs.Panel, { value: "layout", children: /* @__PURE__ */ jsx(Card, { padding: "md", className: "!bg-white dark:!bg-zinc-950", children: /* @__PURE__ */ jsx(LayoutSection, { element, onPatch }) }) }),
2047
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "layout", children: /* @__PURE__ */ jsx(Card, { padding: "md", className: "!bg-white dark:!bg-zinc-950", children: /* @__PURE__ */ jsx(LayoutSection, { element, onPatch, siblings: slide?.elements ?? [] }) }) }),
2037
2048
  /* @__PURE__ */ jsx(Tabs.Panel, { value: "advanced", children: /* @__PURE__ */ jsx(Card, { padding: "md", className: "!bg-white dark:!bg-zinc-950", children: /* @__PURE__ */ jsx(AdvancedSection, { element, onPatch }) }) })
2038
2049
  ] })
2039
2050
  ] }) })
@@ -2238,7 +2249,10 @@ function buildLabel(element) {
2238
2249
  }
2239
2250
  return `${element.type} #${element.id.slice(-6)}`;
2240
2251
  }
2241
- function LayoutSection({ element, onPatch }) {
2252
+ function LayoutSection({ element, onPatch, siblings }) {
2253
+ const zs = siblings.map((e) => e.z ?? 0);
2254
+ const bringToFront = () => onPatch({ z: (zs.length ? Math.max(...zs) : 0) + 1 });
2255
+ const sendToBack = () => onPatch({ z: (zs.length ? Math.min(...zs) : 0) - 1 });
2242
2256
  return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2243
2257
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
2244
2258
  /* @__PURE__ */ jsx(Input, { label: "X", type: "number", value: String(roundFrac(element.x)), onChange: (e) => onPatch({ x: clamp2(parseFloat(e.target.value), 0, 1) }) }),
@@ -2248,7 +2262,26 @@ function LayoutSection({ element, onPatch }) {
2248
2262
  ] }),
2249
2263
  /* @__PURE__ */ jsx(Separator, {}),
2250
2264
  /* @__PURE__ */ jsx(Slider, { label: "Rotation", value: element.rotation ?? 0, onValueChange: (v) => onPatch({ rotation: Number(v) }), min: -180, max: 180 }),
2251
- /* @__PURE__ */ jsx(Input, { label: "Z-index", type: "number", value: String(element.z ?? 0), onChange: (e) => onPatch({ z: parseInt(e.target.value, 10) || 0 }) })
2265
+ /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
2266
+ /* @__PURE__ */ jsx(Input, { label: "Z-index", type: "number", value: String(element.z ?? 0), onChange: (e) => onPatch({ z: parseInt(e.target.value, 10) || 0 }), className: "flex-1" }),
2267
+ /* @__PURE__ */ jsx(Action, { size: "sm", variant: "ghost", onClick: bringToFront, "aria-label": "Bring to front", children: "Front" }),
2268
+ /* @__PURE__ */ jsx(Action, { size: "sm", variant: "ghost", onClick: sendToBack, "aria-label": "Send to back", children: "Back" })
2269
+ ] }),
2270
+ /* @__PURE__ */ jsx(Separator, {}),
2271
+ /* @__PURE__ */ jsx(
2272
+ Input,
2273
+ {
2274
+ label: "Link (href)",
2275
+ value: element.href ?? "",
2276
+ placeholder: "https://\u2026",
2277
+ onChange: (e) => onPatch({ href: e.target.value || void 0 })
2278
+ }
2279
+ ),
2280
+ /* @__PURE__ */ jsxs(Text, { size: "xs", className: "!text-zinc-500", children: [
2281
+ "Makes the whole element a click target in the viewer (opens a new tab) and exports as a pptx hyperlink. For links inside text, use markdown ",
2282
+ /* @__PURE__ */ jsx("code", { children: "[label](url)" }),
2283
+ "."
2284
+ ] })
2252
2285
  ] });
2253
2286
  }
2254
2287
  function AdvancedSection({ element, onPatch }) {
@@ -3070,6 +3103,9 @@ function DeckEditor({
3070
3103
  );
3071
3104
  }
3072
3105
 
3073
- export { DeckEditor, EditorToolbar, ElementInspector, ImageElementRenderer, PRESENTATION_EDITOR_ACTIONS, PresenterView, ShapeElementRenderer, Slide, SlideRail, SlideThumbnail, SlideViewer, SpeakerNotes, TextElementRenderer, buildSteps, buildsForStep, builtinThemes, chartStarterOption, collectBuilds, darkTheme, deckId, defaultTheme, defineTheme, elementId, isByParagraph, nextId, normalizeSlideMarkdown, paragraphReveals, reduce as reduceDeck, resolveTheme, slideId, splitParagraphs, stepDelays, totalBuildSteps, useDeckState, useSlideKeyboard, visibleElementIds, vividTheme };
3106
+ // src/types.ts
3107
+ var SCHEMA_VERSION = 1;
3108
+
3109
+ export { DeckEditor, EditorToolbar, ElementInspector, ImageElementRenderer, PRESENTATION_EDITOR_ACTIONS, PresenterView, SCHEMA_VERSION, ShapeElementRenderer, Slide, SlideRail, SlideThumbnail, SlideViewer, SpeakerNotes, TextElementRenderer, buildSteps, buildsForStep, builtinThemes, chartStarterOption, collectBuilds, darkTheme, deckId, defaultTheme, defineTheme, elementId, isByParagraph, nextId, normalizeSlideMarkdown, paragraphReveals, reduce as reduceDeck, resolveTheme, slideId, splitParagraphs, stepDelays, totalBuildSteps, useDeckState, useSlideKeyboard, visibleElementIds, vividTheme };
3074
3110
  //# sourceMappingURL=index.js.map
3075
3111
  //# sourceMappingURL=index.js.map