@markdy/core 1.0.13 → 1.0.14

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.ts CHANGED
@@ -26,6 +26,10 @@ type PlayerControlsConfig = {
26
26
  fullscreen?: boolean;
27
27
  svg?: boolean;
28
28
  share?: boolean;
29
+ /** Show the MarkdyScript source code when clicked. */
30
+ code?: boolean;
31
+ /** Theme switcher toggle (dark / light palettes). */
32
+ theme?: boolean;
29
33
  /** Speed multipliers offered by the speed buttons. */
30
34
  speeds?: number[];
31
35
  };
package/dist/index.js CHANGED
@@ -397,7 +397,9 @@ var CONTROL_KEYS = [
397
397
  "resetView",
398
398
  "fullscreen",
399
399
  "svg",
400
- "share"
400
+ "share",
401
+ "code",
402
+ "theme"
401
403
  ];
402
404
  var INTERACTION_KEYS = ["zoom", "pan", "doubleClickToReset"];
403
405
  var PLAYBACK = {
@@ -448,7 +450,19 @@ var CONTROLS = {
448
450
  export_svg: { group: "controls", key: "svg", type: "boolean" },
449
451
  share: { group: "controls", key: "share", type: "boolean" },
450
452
  shareLink: { group: "controls", key: "share", type: "boolean" },
451
- share_link: { group: "controls", key: "share", type: "boolean" }
453
+ share_link: { group: "controls", key: "share", type: "boolean" },
454
+ code: { group: "controls", key: "code", type: "boolean" },
455
+ codeButton: { group: "controls", key: "code", type: "boolean" },
456
+ code_button: { group: "controls", key: "code", type: "boolean" },
457
+ exposeCode: { group: "controls", key: "code", type: "boolean" },
458
+ expose_code: { group: "controls", key: "code", type: "boolean" },
459
+ viewSource: { group: "controls", key: "code", type: "boolean" },
460
+ view_source: { group: "controls", key: "code", type: "boolean" },
461
+ theme: { group: "controls", key: "theme", type: "boolean" },
462
+ themeButton: { group: "controls", key: "theme", type: "boolean" },
463
+ theme_button: { group: "controls", key: "theme", type: "boolean" },
464
+ switchTheme: { group: "controls", key: "theme", type: "boolean" },
465
+ switch_theme: { group: "controls", key: "theme", type: "boolean" }
452
466
  };
453
467
  var INTERACTION = {
454
468
  interactive: { group: "interaction", key: "*", type: "group" },
@@ -516,6 +530,13 @@ var FLAT = {
516
530
  export_svg: CONTROLS.export_svg,
517
531
  shareLink: CONTROLS.shareLink,
518
532
  share_link: CONTROLS.share_link,
533
+ code: CONTROLS.code,
534
+ codeButton: CONTROLS.codeButton,
535
+ code_button: CONTROLS.code_button,
536
+ exposeCode: CONTROLS.exposeCode,
537
+ expose_code: CONTROLS.expose_code,
538
+ viewSource: CONTROLS.viewSource,
539
+ view_source: CONTROLS.view_source,
519
540
  interactive: INTERACTION.interactive,
520
541
  interactiveViewport: INTERACTION.interactiveViewport,
521
542
  interactive_viewport: INTERACTION.interactive_viewport,
@@ -604,7 +625,11 @@ function resolvePlayer(config = {}, overrides = {}) {
604
625
  resetView: controlsOn && (config.controls?.resetView ?? true),
605
626
  fullscreen: controlsOn && (config.controls?.fullscreen ?? true),
606
627
  svg: controlsOn && (config.controls?.svg ?? true),
607
- share: controlsOn && (config.controls?.share ?? true)
628
+ share: controlsOn && (config.controls?.share ?? true),
629
+ // `code` is opt-in: off by default, on only when explicitly declared true.
630
+ code: controlsOn && (config.controls?.code ?? false),
631
+ // `theme` is opt-in: off by default, on only when explicitly declared true.
632
+ theme: controlsOn && (config.controls?.theme ?? false)
608
633
  };
609
634
  const interactionOn = overrides.interactiveViewport !== false && (overrides.interactiveViewport === true || config.interaction !== void 0 || overrides.controls === true);
610
635
  const gestures = {
@@ -614,7 +639,7 @@ function resolvePlayer(config = {}, overrides = {}) {
614
639
  };
615
640
  const interactionEnabled = gestures.zoom || gestures.pan || gestures.doubleClickToReset;
616
641
  const resetView = controls.resetView && interactionEnabled;
617
- const controlsEnabled = controls.play || controls.restart || controls.prevBeat || controls.nextBeat || controls.seek || controls.speed || controls.fit || controls.resetView || controls.fullscreen || controls.svg || controls.share || resetView;
642
+ const controlsEnabled = controls.play || controls.restart || controls.prevBeat || controls.nextBeat || controls.seek || controls.speed || controls.fit || controls.resetView || controls.fullscreen || controls.svg || controls.share || controls.code || controls.theme || resetView;
618
643
  const rate = overrides.playbackRate ?? playback.rate ?? 1;
619
644
  return {
620
645
  playback: {
@@ -626,7 +651,7 @@ function resolvePlayer(config = {}, overrides = {}) {
626
651
  ...controls,
627
652
  resetView,
628
653
  enabled: controlsEnabled,
629
- speeds: config.controls?.speeds?.length ? config.controls.speeds : [0.5, 1, 2]
654
+ speeds: config.controls?.speeds?.length ? config.controls.speeds : [0.1, 0.25, 0.5, 1, 1.5]
630
655
  },
631
656
  interaction: {
632
657
  ...gestures,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/core",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Diagram-native MarkdyScript parser and compiler (auto-layout, edge routing, cue scheduling) — zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "type": "module",