@arcanewizards/timecode-toolbox 0.1.0 → 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.
- package/LICENSE +21 -0
- package/dist/components/frontend/index.js +865 -272
- package/dist/components/frontend/index.mjs +855 -262
- package/dist/entrypoint.css +163 -53
- package/dist/entrypoint.js +1474 -493
- package/dist/entrypoint.js.map +4 -4
- package/dist/frontend.js +1474 -493
- package/dist/frontend.js.map +4 -4
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +308 -37
- package/dist/index.mjs +329 -49
- package/dist/start.d.mts +1 -2
- package/dist/start.d.ts +1 -2
- package/dist/start.js +311 -38
- package/dist/start.mjs +332 -50
- package/package.json +12 -6
- package/.turbo/turbo-build.log +0 -58
- package/.turbo/turbo-lint.log +0 -4
- package/CHANGELOG.md +0 -40
- package/eslint.config.mjs +0 -49
- package/src/app.tsx +0 -147
- package/src/components/backend/index.ts +0 -6
- package/src/components/backend/toolbox-root.ts +0 -119
- package/src/components/frontend/constants.ts +0 -81
- package/src/components/frontend/entrypoint.ts +0 -12
- package/src/components/frontend/frontend.css +0 -108
- package/src/components/frontend/index.tsx +0 -46
- package/src/components/frontend/toolbox/content.tsx +0 -45
- package/src/components/frontend/toolbox/context.tsx +0 -63
- package/src/components/frontend/toolbox/core/size-aware-div.tsx +0 -51
- package/src/components/frontend/toolbox/core/timecode-display.tsx +0 -592
- package/src/components/frontend/toolbox/generators.tsx +0 -318
- package/src/components/frontend/toolbox/inputs.tsx +0 -484
- package/src/components/frontend/toolbox/outputs.tsx +0 -581
- package/src/components/frontend/toolbox/preferences.ts +0 -25
- package/src/components/frontend/toolbox/root.tsx +0 -335
- package/src/components/frontend/toolbox/settings.tsx +0 -54
- package/src/components/frontend/toolbox/types.ts +0 -28
- package/src/components/frontend/toolbox/util.tsx +0 -61
- package/src/components/proto.ts +0 -420
- package/src/config.ts +0 -7
- package/src/generators/clock.tsx +0 -206
- package/src/generators/index.tsx +0 -15
- package/src/index.ts +0 -38
- package/src/inputs/artnet.tsx +0 -305
- package/src/inputs/index.tsx +0 -13
- package/src/inputs/tcnet.tsx +0 -272
- package/src/outputs/artnet.tsx +0 -170
- package/src/outputs/index.tsx +0 -11
- package/src/start.ts +0 -47
- package/src/tree.ts +0 -133
- package/src/types.ts +0 -12
- package/src/urls.ts +0 -49
- package/src/util.ts +0 -82
- package/tailwind.config.cjs +0 -7
- package/tsconfig.json +0 -10
- package/tsup.config.ts +0 -10
package/CHANGELOG.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# @arcanewizards/timecode-toolbox
|
|
2
|
-
|
|
3
|
-
## 0.1.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- 046e311: Allow timecode-toolbox to be run from cli
|
|
8
|
-
|
|
9
|
-
Introduce a "bin" entry to allow for the package to be installed via npx,
|
|
10
|
-
or globally, and executed easily on a host machine.
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- 109936d: Correct dependencies in timecode-toolbox
|
|
15
|
-
|
|
16
|
-
Certain dev dependencies were incorrectly listed as normal dependencies,
|
|
17
|
-
meaning they would be incorrectly installed.
|
|
18
|
-
|
|
19
|
-
## 0.0.3
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- Introduce Appearance Settings
|
|
24
|
-
|
|
25
|
-
Make it possible to choose between light/dark/os mode,
|
|
26
|
-
and to pick a primary interface color.
|
|
27
|
-
|
|
28
|
-
- Introduce new clock generator
|
|
29
|
-
|
|
30
|
-
Introduce a new generator that uses the local time of the system clock,
|
|
31
|
-
and can be started, stopped, reset etc...
|
|
32
|
-
|
|
33
|
-
This can be connected to an output like all the existing inputs.
|
|
34
|
-
|
|
35
|
-
- Allow individual timecodes to be opened in new window
|
|
36
|
-
|
|
37
|
-
For cases where users want to be able to focus on one particular timecode,
|
|
38
|
-
or have complex multi-window / workspace. /monitor setups where they want to be
|
|
39
|
-
able to display specific timecodes in different places,
|
|
40
|
-
it's now possible to open a specific timecode in a new window.
|
package/eslint.config.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'eslint/config';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import { dirname } from 'path';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
tsParser,
|
|
7
|
-
js,
|
|
8
|
-
FlatCompat,
|
|
9
|
-
} from '@arcanewizards/eslint-config/dependencies.js';
|
|
10
|
-
import eslintPluginBetterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
11
|
-
import reactTailwindConfig from '@arcanewizards/eslint-config/react-tailwind.js';
|
|
12
|
-
|
|
13
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
-
const __dirname = dirname(__filename);
|
|
15
|
-
const { REACT_TAILWIND_CALLEES } = reactTailwindConfig;
|
|
16
|
-
|
|
17
|
-
const compat = new FlatCompat({
|
|
18
|
-
baseDirectory: __dirname,
|
|
19
|
-
recommendedConfig: js.configs.recommended,
|
|
20
|
-
allConfig: js.configs.all,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export default defineConfig([
|
|
24
|
-
{
|
|
25
|
-
extends: compat.extends('@arcanewizards/eslint-config/library.js'),
|
|
26
|
-
|
|
27
|
-
languageOptions: {
|
|
28
|
-
parser: tsParser,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
extends: [eslintPluginBetterTailwindcss.configs.recommended],
|
|
33
|
-
settings: {
|
|
34
|
-
'better-tailwindcss': {
|
|
35
|
-
entryPoint: './src/components/frontend/frontend.css',
|
|
36
|
-
tsconfig: './tsconfig.json',
|
|
37
|
-
callees: REACT_TAILWIND_CALLEES,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
rules: {
|
|
41
|
-
'better-tailwindcss/no-unknown-classes': 'error',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
rules: {
|
|
46
|
-
'turbo/no-undeclared-env-vars': 'off',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
]);
|
package/src/app.tsx
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppShell,
|
|
3
|
-
AppListenerManager,
|
|
4
|
-
SigilRuntimeAppProps,
|
|
5
|
-
} from '@arcanewizards/sigil';
|
|
6
|
-
import {
|
|
7
|
-
JSX,
|
|
8
|
-
ReactNode,
|
|
9
|
-
useCallback,
|
|
10
|
-
useEffect,
|
|
11
|
-
useMemo,
|
|
12
|
-
useState,
|
|
13
|
-
} from 'react';
|
|
14
|
-
import { C } from './components/backend';
|
|
15
|
-
import { ToolboxConfigData } from './config';
|
|
16
|
-
import path from 'node:path';
|
|
17
|
-
import { useDataFileContext } from '@arcanejs/react-toolkit/data';
|
|
18
|
-
import {
|
|
19
|
-
ApplicationState,
|
|
20
|
-
AvailableHandlers,
|
|
21
|
-
DEFAULT_CONFIG,
|
|
22
|
-
TimecodeHandlerMethods,
|
|
23
|
-
ToolboxConfig,
|
|
24
|
-
ToolboxRootCallHandler,
|
|
25
|
-
} from './components/proto';
|
|
26
|
-
import { patchJson, Diff } from '@arcanejs/diff';
|
|
27
|
-
import { InputConnections } from './inputs';
|
|
28
|
-
import { OutputConnections } from './outputs';
|
|
29
|
-
import { Generators } from './generators';
|
|
30
|
-
import { TimecodeHandlers } from './types';
|
|
31
|
-
import { getTreeValue, mapTree, Tree } from './tree';
|
|
32
|
-
|
|
33
|
-
export type AppApi = Record<never, never>;
|
|
34
|
-
|
|
35
|
-
export type TimecodeToolboxAppProps = {
|
|
36
|
-
dataDirectory: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type AppProps = SigilRuntimeAppProps<AppApi, TimecodeToolboxAppProps>;
|
|
40
|
-
|
|
41
|
-
export const App = ({
|
|
42
|
-
title,
|
|
43
|
-
version,
|
|
44
|
-
toolkit,
|
|
45
|
-
dataDirectory,
|
|
46
|
-
logger,
|
|
47
|
-
logEventEmitter,
|
|
48
|
-
setWindowUrl,
|
|
49
|
-
shutdownContext,
|
|
50
|
-
}: AppProps): ReactNode => {
|
|
51
|
-
const { data, error, updateData, resetData } =
|
|
52
|
-
useDataFileContext(ToolboxConfigData);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (error) {
|
|
56
|
-
logger.warn('Resetting config to application default');
|
|
57
|
-
resetData();
|
|
58
|
-
}
|
|
59
|
-
}, [logger, error, resetData]);
|
|
60
|
-
|
|
61
|
-
const onUpdateConfig = (diff: Diff<ToolboxConfig>) => {
|
|
62
|
-
updateData((prev) => patchJson(prev, diff) ?? DEFAULT_CONFIG);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const [state, setState] = useState<Omit<ApplicationState, 'handlers'>>({
|
|
66
|
-
inputs: {},
|
|
67
|
-
outputs: {},
|
|
68
|
-
generators: {},
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const [handlers, setHandlers] = useState<TimecodeHandlers>({ children: {} });
|
|
72
|
-
|
|
73
|
-
const availableHandlers: Tree<AvailableHandlers> = useMemo(
|
|
74
|
-
() =>
|
|
75
|
-
mapTree(handlers, (node) =>
|
|
76
|
-
Object.fromEntries(
|
|
77
|
-
Object.entries(node)
|
|
78
|
-
.filter(([_, handler]) => handler)
|
|
79
|
-
.map(([key]) => [key, true]),
|
|
80
|
-
),
|
|
81
|
-
),
|
|
82
|
-
[handlers],
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const callHandler = useCallback(
|
|
86
|
-
async <H extends keyof AvailableHandlers>(
|
|
87
|
-
call: ToolboxRootCallHandler<H>,
|
|
88
|
-
) => {
|
|
89
|
-
const handlerFunc = getTreeValue(handlers, call.path)?.[call.handler];
|
|
90
|
-
if (handlerFunc) {
|
|
91
|
-
return await (
|
|
92
|
-
handlerFunc as (
|
|
93
|
-
...args: Parameters<NonNullable<TimecodeHandlerMethods[H]>>
|
|
94
|
-
) => void
|
|
95
|
-
)(...call.args);
|
|
96
|
-
}
|
|
97
|
-
throw new Error(
|
|
98
|
-
`No handler found for path: ${call.path.join(' -> ')} and handler: ${call.handler}`,
|
|
99
|
-
);
|
|
100
|
-
},
|
|
101
|
-
[handlers],
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<AppShell
|
|
106
|
-
title={title}
|
|
107
|
-
version={version}
|
|
108
|
-
dataDirectory={dataDirectory}
|
|
109
|
-
logger={logger}
|
|
110
|
-
logEventEmitter={logEventEmitter}
|
|
111
|
-
shutdownContext={shutdownContext}
|
|
112
|
-
>
|
|
113
|
-
<C.ToolboxRoot
|
|
114
|
-
config={data}
|
|
115
|
-
state={state}
|
|
116
|
-
handlers={availableHandlers}
|
|
117
|
-
onUpdateConfig={onUpdateConfig}
|
|
118
|
-
onCallHandler={callHandler}
|
|
119
|
-
/>
|
|
120
|
-
<InputConnections state={state} setState={setState} />
|
|
121
|
-
<Generators state={state} setState={setState} setHandlers={setHandlers} />
|
|
122
|
-
<OutputConnections state={state} setState={setState} />
|
|
123
|
-
<AppListenerManager
|
|
124
|
-
toolkit={toolkit}
|
|
125
|
-
setWindowUrl={setWindowUrl}
|
|
126
|
-
listenerConfig={{
|
|
127
|
-
default: {
|
|
128
|
-
port: {
|
|
129
|
-
from: 4100,
|
|
130
|
-
to: 4200,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
}}
|
|
134
|
-
/>
|
|
135
|
-
</AppShell>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const createApp = (props: AppProps): JSX.Element => {
|
|
140
|
-
return (
|
|
141
|
-
<ToolboxConfigData.Provider
|
|
142
|
-
path={path.join(props.dataDirectory, 'config.json')}
|
|
143
|
-
>
|
|
144
|
-
<App {...props} />
|
|
145
|
-
</ToolboxConfigData.Provider>
|
|
146
|
-
);
|
|
147
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { IDMap } from '@arcanejs/toolkit/util';
|
|
2
|
-
import { Diff } from '@arcanejs/diff';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Base,
|
|
6
|
-
EventEmitter,
|
|
7
|
-
Listenable,
|
|
8
|
-
} from '@arcanejs/toolkit/components/base';
|
|
9
|
-
import {
|
|
10
|
-
TimecodeToolboxComponentCalls,
|
|
11
|
-
Namespace,
|
|
12
|
-
ToolboxRootComponent,
|
|
13
|
-
ToolboxConfig,
|
|
14
|
-
isTimecodeToolboxComponentMessage,
|
|
15
|
-
DEFAULT_CONFIG,
|
|
16
|
-
isTimecodeToolboxComponentCall,
|
|
17
|
-
ToolboxRootCallHandler,
|
|
18
|
-
} from '../proto';
|
|
19
|
-
import {
|
|
20
|
-
AnyClientComponentCall,
|
|
21
|
-
AnyClientComponentMessage,
|
|
22
|
-
} from '@arcanejs/protocol';
|
|
23
|
-
import { getNetworkInterfaces } from '@arcanewizards/net-utils';
|
|
24
|
-
|
|
25
|
-
export type Events = {
|
|
26
|
-
updateConfig: (diff: Diff<ToolboxConfig>) => void;
|
|
27
|
-
callHandler: (call: ToolboxRootCallHandler) => Promise<void>;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type AppRootProps = Pick<
|
|
31
|
-
ToolboxRootComponent,
|
|
32
|
-
'config' | 'state' | 'handlers'
|
|
33
|
-
> & {
|
|
34
|
-
onUpdateConfig?: Events['updateConfig'];
|
|
35
|
-
onCallHandler?: Events['callHandler'];
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const DEFAULT_PROPS: AppRootProps = {
|
|
39
|
-
config: DEFAULT_CONFIG,
|
|
40
|
-
state: {
|
|
41
|
-
inputs: {},
|
|
42
|
-
outputs: {},
|
|
43
|
-
generators: {},
|
|
44
|
-
},
|
|
45
|
-
handlers: { children: {} },
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export class ToolboxRoot
|
|
49
|
-
extends Base<
|
|
50
|
-
Namespace,
|
|
51
|
-
ToolboxRootComponent,
|
|
52
|
-
AppRootProps,
|
|
53
|
-
TimecodeToolboxComponentCalls
|
|
54
|
-
>
|
|
55
|
-
implements Listenable<Events>
|
|
56
|
-
{
|
|
57
|
-
/** @hidden */
|
|
58
|
-
private readonly events = new EventEmitter<Events>();
|
|
59
|
-
|
|
60
|
-
public constructor(props: AppRootProps) {
|
|
61
|
-
super(DEFAULT_PROPS, props, {
|
|
62
|
-
onPropsUpdated: (oldProps) =>
|
|
63
|
-
this.events.processPropChanges(
|
|
64
|
-
{
|
|
65
|
-
onUpdateConfig: 'updateConfig',
|
|
66
|
-
onCallHandler: 'callHandler',
|
|
67
|
-
},
|
|
68
|
-
oldProps,
|
|
69
|
-
this.props,
|
|
70
|
-
),
|
|
71
|
-
});
|
|
72
|
-
this.triggerInitialPropsUpdate();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
addListener = this.events.addListener;
|
|
76
|
-
removeListener = this.events.removeListener;
|
|
77
|
-
|
|
78
|
-
/** @hidden */
|
|
79
|
-
public getProtoInfo(idMap: IDMap): ToolboxRootComponent {
|
|
80
|
-
return {
|
|
81
|
-
namespace: 'timecode-toolbox',
|
|
82
|
-
component: 'toolbox-root',
|
|
83
|
-
key: idMap.getId(this),
|
|
84
|
-
config: this.props.config,
|
|
85
|
-
state: this.props.state,
|
|
86
|
-
handlers: this.props.handlers,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** @hidden */
|
|
91
|
-
public handleMessage = (message: AnyClientComponentMessage) => {
|
|
92
|
-
if (isTimecodeToolboxComponentMessage(message, 'toolbox-root')) {
|
|
93
|
-
if (message.action === 'update-config') {
|
|
94
|
-
this.events.emit('updateConfig', message.diff);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/** @hidden */
|
|
100
|
-
public handleCall = async (call: AnyClientComponentCall) => {
|
|
101
|
-
if (
|
|
102
|
-
isTimecodeToolboxComponentCall(
|
|
103
|
-
call,
|
|
104
|
-
'toolbox-root-get-network-interfaces',
|
|
105
|
-
)
|
|
106
|
-
) {
|
|
107
|
-
return getNetworkInterfaces();
|
|
108
|
-
} else if (
|
|
109
|
-
isTimecodeToolboxComponentCall(call, 'toolbox-root-call-handler')
|
|
110
|
-
) {
|
|
111
|
-
const result = await this.events.emit('callHandler', call);
|
|
112
|
-
if (result[0]) {
|
|
113
|
-
return result[0];
|
|
114
|
-
}
|
|
115
|
-
throw new Error(`No handler for callHandler`);
|
|
116
|
-
}
|
|
117
|
-
throw new Error(`Unhandled call action: ${call.action}`);
|
|
118
|
-
};
|
|
119
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { TIMECODE_FPS } from '@arcanewizards/artnet/constants';
|
|
2
|
-
|
|
3
|
-
const MS_FORMAT = new Intl.NumberFormat(undefined, {
|
|
4
|
-
style: 'unit',
|
|
5
|
-
unit: 'millisecond',
|
|
6
|
-
maximumFractionDigits: 0,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const STRINGS = {
|
|
10
|
-
title: 'Timecode Toolbox',
|
|
11
|
-
debugger: 'Debug Tools & Log',
|
|
12
|
-
connectionError: 'Disconnected from Timecode Toolbox Server',
|
|
13
|
-
reconnect: 'Reconnect',
|
|
14
|
-
openInNewWindow: 'Open in new window',
|
|
15
|
-
toggle: (text: string) => `Toggle ${text}`,
|
|
16
|
-
close: (text: string) => `Close ${text}`,
|
|
17
|
-
protocols: {
|
|
18
|
-
artnet: {
|
|
19
|
-
short: 'ArtNet',
|
|
20
|
-
long: 'ArtNet',
|
|
21
|
-
},
|
|
22
|
-
tcnet: {
|
|
23
|
-
short: 'TCNet',
|
|
24
|
-
long: 'TCNet (ShowKontrol / Pioneer)',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
inputs: {
|
|
28
|
-
title: 'INPUTS',
|
|
29
|
-
noChildren: 'No inputs yet. Please add one using the buttons below.',
|
|
30
|
-
addButton: (protocol: string) => `Add ${protocol}`,
|
|
31
|
-
addDialog: (protocol: string) => `Add ${protocol} Input`,
|
|
32
|
-
editDialog: (protocol: string, name: string) =>
|
|
33
|
-
`Edit ${protocol} Input ${name}`,
|
|
34
|
-
},
|
|
35
|
-
smtpeModes: {
|
|
36
|
-
SMPTE: `SMPTE ${TIMECODE_FPS.SMPTE}FPS`,
|
|
37
|
-
FILM: `FILM ${TIMECODE_FPS.FILM}FPS`,
|
|
38
|
-
EBU: `EBU ${TIMECODE_FPS.EBU}FPS`,
|
|
39
|
-
DF: `DF ${TIMECODE_FPS.DF}FPS`,
|
|
40
|
-
},
|
|
41
|
-
smtpeModeOptions: {
|
|
42
|
-
SMPTE: `SMPTE (${TIMECODE_FPS.SMPTE}FPS) (Recommended)`,
|
|
43
|
-
FILM: `FILM (${TIMECODE_FPS.FILM}FPS)`,
|
|
44
|
-
EBU: `EBU (${TIMECODE_FPS.EBU}FPS)`,
|
|
45
|
-
DF: `DF (${TIMECODE_FPS.DF}FPS)`,
|
|
46
|
-
},
|
|
47
|
-
accuracy: (accuracyMillis: number) =>
|
|
48
|
-
`Accuracy: ${MS_FORMAT.format(accuracyMillis)}`,
|
|
49
|
-
delay: (delayMs: number) => `Delay: ${MS_FORMAT.format(delayMs)}`,
|
|
50
|
-
generators: {
|
|
51
|
-
title: 'GENERATORS',
|
|
52
|
-
noChildren: 'No generators yet. Please add one using the buttons below.',
|
|
53
|
-
type: {
|
|
54
|
-
clock: 'Clock',
|
|
55
|
-
},
|
|
56
|
-
addDialog: (protocol: string) => `Add ${protocol} Generator`,
|
|
57
|
-
editDialog: (protocol: string, name: string) =>
|
|
58
|
-
`Edit ${protocol} Generator ${name}`,
|
|
59
|
-
},
|
|
60
|
-
outputs: {
|
|
61
|
-
title: 'OUTPUTS',
|
|
62
|
-
noChildren: 'No outputs yet. Please add one using the buttons below.',
|
|
63
|
-
addButton: (protocol: string) => `Add ${protocol}`,
|
|
64
|
-
addDialog: (protocol: string) => `Add ${protocol} Output`,
|
|
65
|
-
editDialog: (protocol: string, name: string) =>
|
|
66
|
-
`Edit ${protocol} Output ${name}`,
|
|
67
|
-
},
|
|
68
|
-
settings: {
|
|
69
|
-
title: 'Settings',
|
|
70
|
-
},
|
|
71
|
-
controls: {
|
|
72
|
-
play: 'Play',
|
|
73
|
-
pause: 'Pause',
|
|
74
|
-
beginning: 'Reset timecode to start',
|
|
75
|
-
back5seconds: 'Back 5 Seconds',
|
|
76
|
-
forward5seconds: 'Forward 5 Seconds',
|
|
77
|
-
},
|
|
78
|
-
errors: {
|
|
79
|
-
unknownTimecodeID: 'Unknown timecode ID, please close the window',
|
|
80
|
-
},
|
|
81
|
-
} as const;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
startTimecodeToolboxServerFrontend,
|
|
3
|
-
TimecodeToolboxBrowserContext,
|
|
4
|
-
} from '.';
|
|
5
|
-
|
|
6
|
-
declare global {
|
|
7
|
-
interface Window {
|
|
8
|
-
BROWSER_CONTEXT?: TimecodeToolboxBrowserContext;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
startTimecodeToolboxServerFrontend(window.BROWSER_CONTEXT);
|
|
@@ -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
|
-
};
|