@arcanewizards/timecode-toolbox 0.0.3 → 0.1.1

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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/frontend/index.d.mts +13 -0
  3. package/dist/components/frontend/index.d.ts +13 -0
  4. package/dist/components/frontend/index.js +18978 -0
  5. package/dist/components/frontend/index.mjs +19016 -0
  6. package/dist/entrypoint.css +2788 -0
  7. package/dist/entrypoint.js +42821 -0
  8. package/dist/entrypoint.js.map +7 -0
  9. package/dist/frontend.js +42818 -0
  10. package/dist/frontend.js.map +7 -0
  11. package/dist/index.d.mts +59 -0
  12. package/dist/index.d.ts +59 -0
  13. package/dist/index.js +14894 -0
  14. package/dist/index.mjs +14921 -0
  15. package/dist/start.d.mts +1 -0
  16. package/dist/start.d.ts +1 -0
  17. package/dist/start.js +14886 -0
  18. package/dist/start.mjs +14918 -0
  19. package/package.json +37 -28
  20. package/.turbo/turbo-build.log +0 -55
  21. package/CHANGELOG.md +0 -24
  22. package/eslint.config.mjs +0 -49
  23. package/src/app.tsx +0 -147
  24. package/src/components/backend/index.ts +0 -6
  25. package/src/components/backend/toolbox-root.ts +0 -119
  26. package/src/components/frontend/constants.ts +0 -81
  27. package/src/components/frontend/entrypoint.ts +0 -12
  28. package/src/components/frontend/frontend.css +0 -108
  29. package/src/components/frontend/index.tsx +0 -46
  30. package/src/components/frontend/toolbox/content.tsx +0 -45
  31. package/src/components/frontend/toolbox/context.tsx +0 -63
  32. package/src/components/frontend/toolbox/core/size-aware-div.tsx +0 -51
  33. package/src/components/frontend/toolbox/core/timecode-display.tsx +0 -592
  34. package/src/components/frontend/toolbox/generators.tsx +0 -318
  35. package/src/components/frontend/toolbox/inputs.tsx +0 -484
  36. package/src/components/frontend/toolbox/outputs.tsx +0 -581
  37. package/src/components/frontend/toolbox/preferences.ts +0 -25
  38. package/src/components/frontend/toolbox/root.tsx +0 -335
  39. package/src/components/frontend/toolbox/settings.tsx +0 -54
  40. package/src/components/frontend/toolbox/types.ts +0 -28
  41. package/src/components/frontend/toolbox/util.tsx +0 -61
  42. package/src/components/proto.ts +0 -420
  43. package/src/config.ts +0 -7
  44. package/src/generators/clock.tsx +0 -206
  45. package/src/generators/index.tsx +0 -15
  46. package/src/index.ts +0 -38
  47. package/src/inputs/artnet.tsx +0 -305
  48. package/src/inputs/index.tsx +0 -13
  49. package/src/inputs/tcnet.tsx +0 -272
  50. package/src/outputs/artnet.tsx +0 -170
  51. package/src/outputs/index.tsx +0 -11
  52. package/src/start.ts +0 -47
  53. package/src/tree.ts +0 -133
  54. package/src/types.ts +0 -12
  55. package/src/urls.ts +0 -49
  56. package/src/util.ts +0 -82
  57. package/tailwind.config.cjs +0 -7
  58. package/tsconfig.json +0 -10
  59. package/tsup.config.ts +0 -10
@@ -1,108 +0,0 @@
1
- @import '@arcanejs/toolkit-frontend/styles/core.css';
2
- @import '@arcanejs/toolkit-frontend/styles/theme.css';
3
- @import '@arcanejs/toolkit-frontend/styles/base.css';
4
-
5
- @import '@arcanewizards/sigil/frontend/styles/sigil.css';
6
- @import '@arcanewizards/sigil/frontend/styles/theme.css';
7
- @import '@arcanewizards/sigil/frontend/styles/base.css';
8
-
9
- @source './**/*.{ts,tsx}';
10
-
11
- @theme inline {
12
- /**
13
- * Any (non-theme) tailwind variables that need to be used by component
14
- * classes should be defined here,
15
- * other than those that already exist in `@arcanewizards/sigil`
16
- */
17
- --spacing-timecode-min-height: var(--timecode-min-height);
18
- --text-timecode-adaptive: max(
19
- var(--timecode-min-height),
20
- min(
21
- calc(var(--size-aware-div-height) * 0.7),
22
- calc(var(--size-aware-div-width) * 0.13)
23
- )
24
- );
25
- --text-block-icon: max(
26
- 2rem,
27
- min(calc(var(--size-aware-div-width) * 0.05), 5rem)
28
- );
29
-
30
- --color-timecode-backdrop: oklch(
31
- from var(--timecode-usage-foreground) l c h / calc(alpha * 0.25)
32
- );
33
- --color-timecode-backdrop-hover: oklch(
34
- from var(--timecode-usage-foreground) l c h / calc(alpha * 0.5)
35
- );
36
-
37
- --color-timecode-usage-text: var(--timecode-usage-text);
38
- --color-timecode-usage-foreground: var(--timecode-usage-foreground);
39
- --color-timecode-usage-background: var(--timecode-usage-background);
40
- --color-timecode-usage-border: var(--timecode-usage-border);
41
- --color-timecode-usage-drag-border: var(--timecode-usage-drag-border);
42
- --color-timecode-usage-selected-background: var(
43
- --timecode-usage-selected-background
44
- );
45
- --color-timecode-usage-selected-border: var(--timecode-usage-selected-border);
46
- --color-timecode-usage-selected-text: var(--timecode-usage-selected-text);
47
- --color-timecode-usage-dimmed-background: var(
48
- --timecode-usage-dimmed-background
49
- );
50
- --color-timecode-usage-dimmed-border: var(--timecode-usage-dimmed-border);
51
-
52
- --font-mono: var(--font-mono);
53
- }
54
-
55
- :root {
56
- --timecode-min-height: 2rem;
57
-
58
- --font-mono:
59
- 'SF Mono', SF Mono, SF Mono Regular, Consolas, 'Liberation Mono', Menlo,
60
- Courier, monospace;
61
- }
62
-
63
- body {
64
- /* prevent window scrollbars from appearing */
65
- overflow: hidden;
66
- }
67
-
68
- .arcane-theme-root {
69
- /* TODO: move this into @arcanejs */
70
- background: var(--arcane-page-bg);
71
-
72
- --timecode-usage-text: var(--sigil-usage-hint-text);
73
- --timecode-usage-foreground: var(--sigil-usage-hint-foreground);
74
- --timecode-usage-background: var(--sigil-usage-hint-background);
75
- --timecode-usage-border: var(--sigil-usage-hint-border);
76
- --timecode-usage-drag-border: var(--sigil-usage-hint-drag-border);
77
- --timecode-usage-selected-background: var(
78
- --sigil-usage-hint-selected-background
79
- );
80
- --timecode-usage-selected-border: var(--sigil-usage-hint-selected-border);
81
- --timecode-usage-selected-text: var(--sigil-usage-hint-selected-text);
82
- --timecode-usage-dimmed-background: var(--sigil-usage-hint-dimmed-background);
83
- --timecode-usage-dimmed-border: var(--sigil-usage-hint-dimmed-border);
84
- }
85
-
86
- body {
87
- user-select: none;
88
- /* TODO: fix arcane bg variable in @arcanejs */
89
- --arcane-page-bg: #1f1f1f;
90
- }
91
-
92
- @utility writing-mode-vertical-rl {
93
- writing-mode: vertical-rl;
94
- }
95
-
96
- @utility app-title-bar {
97
- app-region: drag;
98
- }
99
-
100
- @utility text-hint-gradient {
101
- background: linear-gradient(
102
- to bottom right,
103
- var(--sigil-usage-hint-gradient-light),
104
- var(--sigil-usage-hint-gradient-dark)
105
- );
106
- -webkit-background-clip: text;
107
- -webkit-text-fill-color: transparent;
108
- }
@@ -1,46 +0,0 @@
1
- import { FrontendComponentRenderer } from '@arcanejs/toolkit-frontend/types';
2
- import {
3
- BaseBrowserContext,
4
- startSigilFrontend,
5
- } from '@arcanewizards/sigil/frontend';
6
- import { isTimecodeToolboxComponent, NAMESPACE } from '../proto';
7
- import { ToolboxRoot } from './toolbox/root';
8
-
9
- export type TimecodeToolboxBrowserContext = BaseBrowserContext;
10
-
11
- export const timecodeToolboxFrontendComponents =
12
- (): FrontendComponentRenderer => ({
13
- namespace: NAMESPACE,
14
- render: (info) => {
15
- if (!isTimecodeToolboxComponent(info)) {
16
- throw new Error(`Cannot render component ${info.namespace}`);
17
- }
18
-
19
- switch (info.component) {
20
- case 'toolbox-root':
21
- return <ToolboxRoot info={info} />;
22
- }
23
- },
24
- });
25
-
26
- export const startTimecodeToolboxServerFrontend = (
27
- browser?: TimecodeToolboxBrowserContext | null,
28
- ) => {
29
- startSigilFrontend<TimecodeToolboxBrowserContext>({
30
- browser,
31
- appRenderers: [timecodeToolboxFrontendComponents()],
32
- loadingState: () => (
33
- <div style={{ width: '100%', textAlign: 'center', padding: '2rem' }}>
34
- Loading Toolbox...
35
- </div>
36
- ),
37
- });
38
- };
39
-
40
- declare global {
41
- interface Window {
42
- startTimecodeToolboxServerFrontend?: typeof startTimecodeToolboxServerFrontend;
43
- }
44
- }
45
-
46
- window.startTimecodeToolboxServerFrontend = startTimecodeToolboxServerFrontend;
@@ -1,45 +0,0 @@
1
- import { useBrowserContext } from '@arcanewizards/sigil/frontend';
2
- import { FC } from 'react';
3
- import { SizeAwareDiv } from './core/size-aware-div';
4
- import { Icon } from '@arcanejs/toolkit-frontend/components/core';
5
-
6
- export const ExternalLink = ({
7
- href,
8
- children,
9
- }: {
10
- href: string;
11
- children: React.ReactNode;
12
- }) => {
13
- const { openExternalLink } = useBrowserContext();
14
- return (
15
- <a
16
- href={href}
17
- target="_blank"
18
- rel="noopener noreferrer"
19
- onClick={(e) => {
20
- e.preventDefault();
21
- openExternalLink(href);
22
- }}
23
- className="
24
- text-sigil-usage-hint-foreground no-underline
25
- hover:underline
26
- "
27
- >
28
- {children}
29
- </a>
30
- );
31
- };
32
-
33
- export const NoToolboxChildren: FC<{ text: string }> = ({ text }) => {
34
- return (
35
- <SizeAwareDiv
36
- className="
37
- flex grow flex-col items-center justify-center gap-1 bg-sigil-bg-light
38
- p-1 text-sigil-foreground-muted
39
- "
40
- >
41
- <Icon icon="handyman" className="text-block-icon" />
42
- <div className="text-center">{text}</div>
43
- </SizeAwareDiv>
44
- );
45
- };
@@ -1,63 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
- import {
3
- ApplicationState,
4
- AvailableHandlers,
5
- ToolboxConfig,
6
- ToolboxRootCallHandler,
7
- ToolboxRootGetNetworkInterfacesReturn,
8
- } from '../../proto';
9
- import { Tree } from '../../../tree';
10
-
11
- export type ConfigContextData = {
12
- config: ToolboxConfig;
13
- updateConfig: (change: (current: ToolboxConfig) => ToolboxConfig) => void;
14
- };
15
-
16
- export const ConfigContext = createContext<ConfigContextData>(
17
- new Proxy({} as ConfigContextData, {
18
- get() {
19
- throw new Error('ConfigContext not initialized');
20
- },
21
- }),
22
- );
23
-
24
- export const ApplicationStateContext = createContext<ApplicationState>(
25
- new Proxy({} as ApplicationState, {
26
- get() {
27
- throw new Error('ApplicationStateContext not initialized');
28
- },
29
- }),
30
- );
31
-
32
- export const useApplicationState = () => useContext(ApplicationStateContext);
33
-
34
- export type ApplicationHandlersContextData = {
35
- handlers: Tree<AvailableHandlers>;
36
- callHandler<H extends keyof AvailableHandlers>(
37
- args: Pick<ToolboxRootCallHandler<H>, 'path' | 'handler' | 'args'>,
38
- ): Promise<void>;
39
- };
40
-
41
- export const ApplicationHandlersContext =
42
- createContext<ApplicationHandlersContextData>(
43
- new Proxy({} as ApplicationHandlersContextData, {
44
- get() {
45
- throw new Error('ApplicationHandlersContext not initialized');
46
- },
47
- }),
48
- );
49
-
50
- export const useApplicationHandlers = () =>
51
- useContext(ApplicationHandlersContext);
52
-
53
- type NetworkContextData = {
54
- getNetworkInterfaces: () => Promise<ToolboxRootGetNetworkInterfacesReturn>;
55
- };
56
-
57
- export const NetworkContext = createContext<NetworkContextData>(
58
- new Proxy({} as NetworkContextData, {
59
- get() {
60
- throw new Error('NetworkContext not initialized');
61
- },
62
- }),
63
- );
@@ -1,51 +0,0 @@
1
- import { cssVariables } from '@arcanewizards/sigil/frontend/styling';
2
- import React, { useEffect, useState } from 'react';
3
-
4
- type SizeAwareDivProps = React.HTMLAttributes<HTMLDivElement>;
5
-
6
- /**
7
- * A div component that sets CSS variables of it's current size,
8
- * allowing children to use those variables to adapt to the size of the div.
9
- * The variables set are --size-aware-div-width and --size-aware-div-height.
10
- */
11
- export const SizeAwareDiv: React.FC<SizeAwareDivProps> = ({
12
- children,
13
- style,
14
- ...rest
15
- }) => {
16
- const [div, setDiv] = useState<HTMLDivElement | null>(null);
17
- const [rect, setRect] = useState<DOMRectReadOnly | null>(null);
18
-
19
- useEffect(() => {
20
- // Detect changes in div size
21
- if (!div) {
22
- return;
23
- }
24
- const resizeObserver = new ResizeObserver((entries) => {
25
- for (const entry of entries) {
26
- setRect(entry.contentRect);
27
- }
28
- });
29
- resizeObserver.observe(div);
30
- return () => {
31
- resizeObserver.disconnect();
32
- };
33
- }, [div]);
34
-
35
- return (
36
- <div
37
- ref={setDiv}
38
- {...rest}
39
- style={{
40
- ...style,
41
- ...(rect &&
42
- cssVariables({
43
- '--size-aware-div-width': rect.width + 'px',
44
- '--size-aware-div-height': rect.height + 'px',
45
- })),
46
- }}
47
- >
48
- {children}
49
- </div>
50
- );
51
- };