@coderyo/ui-shell 1.1.0 → 1.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/dist/index.d.ts +20 -2
- package/dist/index.js +44 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { Locale, I18nDictionary } from '@coderyo/i18n';
|
|
|
4
4
|
import { IndicatorConfig } from '@coderyo/indicators';
|
|
5
5
|
import * as _coderyo_drawings from '@coderyo/drawings';
|
|
6
6
|
import { DrawingRecord } from '@coderyo/drawings';
|
|
7
|
+
import { LayerTimeScaleSyncChart as LayerTimeScaleSyncChart$1, LayerBridgePreset, ChartLayerBridgeRegistration, LayerBridgeController } from '@coderyo/core';
|
|
8
|
+
export { ChartLayerBridgeRegistration, isValidLayerBridgePane as isValidBridgeLayerPane } from '@coderyo/core';
|
|
7
9
|
import { BridgeLayerPane } from '@coderyo/bridge';
|
|
8
10
|
import { StreamLanguage } from '@codemirror/language';
|
|
9
|
-
export { isValidLayerBridgePane as isValidBridgeLayerPane } from '@coderyo/core';
|
|
10
11
|
|
|
11
12
|
interface I18nProvider {
|
|
12
13
|
t(key: string, fallback?: string, params?: Record<string, string | number>): string;
|
|
@@ -612,6 +613,23 @@ interface BindLayerTimeScaleSyncOptions {
|
|
|
612
613
|
*/
|
|
613
614
|
declare function bindLayerTimeScaleSync(chart: LayerTimeScaleSyncChart, controller: LayerController, options?: BindLayerTimeScaleSyncOptions): () => void;
|
|
614
615
|
|
|
616
|
+
/** Wrap `LayerController` for `wireChartBridge` / `registerChartLayerBridge`. */
|
|
617
|
+
declare function wrapLayerController(lc: LayerController): LayerBridgeController;
|
|
618
|
+
interface CreateLayerBridgeRegistrationOptions {
|
|
619
|
+
chartId: string;
|
|
620
|
+
chart: LayerTimeScaleSyncChart$1;
|
|
621
|
+
layerController: LayerController;
|
|
622
|
+
compositorApply?: () => void;
|
|
623
|
+
syncCompositorShellVisibility?: () => void;
|
|
624
|
+
normalizePreset?: (input: LayerBridgePreset) => LayerBridgePreset;
|
|
625
|
+
mergePreset?: (current: LayerBridgePreset, partial: LayerBridgePreset) => LayerBridgePreset;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @public Build `ChartLayerBridgeRegistration` for `wireChartBridge({ layerBridge })`.
|
|
629
|
+
* Defaults `normalizePreset` / `mergePreset` to ui-shell layout helpers.
|
|
630
|
+
*/
|
|
631
|
+
declare function createLayerBridgeRegistration(opts: CreateLayerBridgeRegistrationOptions): ChartLayerBridgeRegistration;
|
|
632
|
+
|
|
615
633
|
/**
|
|
616
634
|
* @public Merge partial LayoutPreset v2 into `current` (pages/layers/groups upsert by id).
|
|
617
635
|
* Unmentioned entries are preserved. Result is normalized.
|
|
@@ -668,4 +686,4 @@ declare function mountPineEditorPanel(parent: HTMLElement, opts?: PineEditorPane
|
|
|
668
686
|
|
|
669
687
|
declare const pineLanguage: StreamLanguage<{}>;
|
|
670
688
|
|
|
671
|
-
export { BUILTIN_PRESETS, type BindGroup, type BindLayerTimeScaleSyncOptions, CHART_PANE_LAYER_TYPES, type ChartLayoutOptions, type CompositorShellHandle, type CompositorShellWidgetId, type ContextMenuAction, type ContextMenuOptions, type CreateCompositorShellOptions, type CreateLayoutGridOptions, type CrosshairLegendOptions, DEFAULT_LAYOUT_FEATURES, DEFAULT_LAYOUT_SCHEMA, DEFAULT_SYNC_TIME_SCALE_GROUP, type DrawingContextMenuHandlers, type DrawingPropertiesPanelOptions, type DrawingToolId, GRID_SETTING_KEY, type HostSplitResult, type I18nProvider, LAYER_PRESET_VERSION, LAYOUT_SCHEMA_VERSION, type LayerCompositorHandle, type LayerCompositorOptions, LayerController, type LayerEditorHandle, type LayerEditorOptions, type LayerFrame, type LayerNode, type LayerPanelHandle, type LayerPanelOptions, type LayerPresetAuthor, type LayerTimeScaleSyncChart, type LayerType, type LayerWidgetElements, type LayerWidgetKey, type LayoutFeatures, type LayoutGridHandle, type LayoutPage, type LayoutPreset, type LayoutSchema, type LayoutWidgetElements, type LayoutWidgetId, type LayoutWidgetPlacement, type LogoSlotOptions, OVERLAY_LAYER_TYPES, type OhlcvSnapshot, PINE_SCRIPT_STORAGE_KEY, type PageNavigatorHandle, type PageNavigatorOptions, type PineEditorPanelOptions, type PresetListEntry, RETURN_CURSOR_KEY, type ResolvedLayoutFeatures, type SettingsPanelOptions as SettingsMenuOptions, type SettingsPanelOptions, type StatusBarOptions, type SymbolInputMode, type SymbolSearchDialogHandle, type SymbolSearchDialogOptions, type SymbolSearchOptions, THEME_STORAGE_KEY, type ThemeId, type ThemeProvider, type ThemeToggleOptions, type TopBarOptions, VENDOR_COMPACT_PRESET, VENDOR_DEFAULT_PRESET, VENDOR_DUAL_SYNC_PRESET, applyCompositorShellFeatures, applyThemeToDocument, attachChartContextMenu, attachLayerEditor, bindLayerTimeScaleSync, bindShortcutsModal, clampBBox, clampFrame, cloneLayoutPreset, cloneLayoutSchema, createCompositorShell, createDemoLayoutOptions, createI18nProvider, createLayoutGrid, createSymbolSearchDialog, createThemeProvider, deleteUserPreset, ensureOverlayLayers, expandLegacyChartHostLayers, forkPreset, getBuiltinPreset, getDrawingOverlayVisible, getLayersBoundingBox, getWidgetPlacement, isChartPaneLayerType, isOverlayLayerType, layerTypeForBridgePane, layoutSchemaToPreset, layoutStorageKey, listPresets, loadIndicatorConfig, loadLayoutSchema, loadPineScriptPreference, loadPreset, loadReturnToCursorPreference, loadShowGridPreference, loadTheme, mergeLayoutFeatures, mergeLayoutPreset, mountChartLayout, mountCodeSnippetPanel, mountCrosshairLegend, mountDrawingPropertiesPanel, mountLayerCompositor, mountLayerPanel, mountLogoSlot, mountPageNavigator, mountPineEditorPanel, mountSettingsPanel as mountSettingsMenu, mountSettingsPanel, mountStatusBar, mountSymbolSearch, mountSymbolSearchDialogTrigger, mountThemeToggle, mountTopBar, moveLayerFrames, normalizeLayoutPreset, normalizeLayoutSchema, openDrawingContextMenu, openShortcutsModal, paneIdFromWidgetKey, pineLanguage, presetStorageKey, resizeGroupFrames, resolveLayoutFeatures, resolveLayoutSchema, resolvePaneLayerIds, resolvePreset, saveIndicatorConfig, saveLayoutSchema, savePineScriptPreference, savePreset, saveReturnToCursorPreference, saveShowGridPreference, saveTheme, splitLegacyChartHost, syncAllOverlayLayersToMain, syncCompositorShellVisibilityFromFeatures, syncCrosshairLegendToMain, syncOverlayLayersToMain, upgradeIndicatorHostType, widgetKeyForChartPaneType };
|
|
689
|
+
export { BUILTIN_PRESETS, type BindGroup, type BindLayerTimeScaleSyncOptions, CHART_PANE_LAYER_TYPES, type ChartLayoutOptions, type CompositorShellHandle, type CompositorShellWidgetId, type ContextMenuAction, type ContextMenuOptions, type CreateCompositorShellOptions, type CreateLayerBridgeRegistrationOptions, type CreateLayoutGridOptions, type CrosshairLegendOptions, DEFAULT_LAYOUT_FEATURES, DEFAULT_LAYOUT_SCHEMA, DEFAULT_SYNC_TIME_SCALE_GROUP, type DrawingContextMenuHandlers, type DrawingPropertiesPanelOptions, type DrawingToolId, GRID_SETTING_KEY, type HostSplitResult, type I18nProvider, LAYER_PRESET_VERSION, LAYOUT_SCHEMA_VERSION, type LayerCompositorHandle, type LayerCompositorOptions, LayerController, type LayerEditorHandle, type LayerEditorOptions, type LayerFrame, type LayerNode, type LayerPanelHandle, type LayerPanelOptions, type LayerPresetAuthor, type LayerTimeScaleSyncChart, type LayerType, type LayerWidgetElements, type LayerWidgetKey, type LayoutFeatures, type LayoutGridHandle, type LayoutPage, type LayoutPreset, type LayoutSchema, type LayoutWidgetElements, type LayoutWidgetId, type LayoutWidgetPlacement, type LogoSlotOptions, OVERLAY_LAYER_TYPES, type OhlcvSnapshot, PINE_SCRIPT_STORAGE_KEY, type PageNavigatorHandle, type PageNavigatorOptions, type PineEditorPanelOptions, type PresetListEntry, RETURN_CURSOR_KEY, type ResolvedLayoutFeatures, type SettingsPanelOptions as SettingsMenuOptions, type SettingsPanelOptions, type StatusBarOptions, type SymbolInputMode, type SymbolSearchDialogHandle, type SymbolSearchDialogOptions, type SymbolSearchOptions, THEME_STORAGE_KEY, type ThemeId, type ThemeProvider, type ThemeToggleOptions, type TopBarOptions, VENDOR_COMPACT_PRESET, VENDOR_DEFAULT_PRESET, VENDOR_DUAL_SYNC_PRESET, applyCompositorShellFeatures, applyThemeToDocument, attachChartContextMenu, attachLayerEditor, bindLayerTimeScaleSync, bindShortcutsModal, clampBBox, clampFrame, cloneLayoutPreset, cloneLayoutSchema, createCompositorShell, createDemoLayoutOptions, createI18nProvider, createLayerBridgeRegistration, createLayoutGrid, createSymbolSearchDialog, createThemeProvider, deleteUserPreset, ensureOverlayLayers, expandLegacyChartHostLayers, forkPreset, getBuiltinPreset, getDrawingOverlayVisible, getLayersBoundingBox, getWidgetPlacement, isChartPaneLayerType, isOverlayLayerType, layerTypeForBridgePane, layoutSchemaToPreset, layoutStorageKey, listPresets, loadIndicatorConfig, loadLayoutSchema, loadPineScriptPreference, loadPreset, loadReturnToCursorPreference, loadShowGridPreference, loadTheme, mergeLayoutFeatures, mergeLayoutPreset, mountChartLayout, mountCodeSnippetPanel, mountCrosshairLegend, mountDrawingPropertiesPanel, mountLayerCompositor, mountLayerPanel, mountLogoSlot, mountPageNavigator, mountPineEditorPanel, mountSettingsPanel as mountSettingsMenu, mountSettingsPanel, mountStatusBar, mountSymbolSearch, mountSymbolSearchDialogTrigger, mountThemeToggle, mountTopBar, moveLayerFrames, normalizeLayoutPreset, normalizeLayoutSchema, openDrawingContextMenu, openShortcutsModal, paneIdFromWidgetKey, pineLanguage, presetStorageKey, resizeGroupFrames, resolveLayoutFeatures, resolveLayoutSchema, resolvePaneLayerIds, resolvePreset, saveIndicatorConfig, saveLayoutSchema, savePineScriptPreference, savePreset, saveReturnToCursorPreference, saveShowGridPreference, saveTheme, splitLegacyChartHost, syncAllOverlayLayersToMain, syncCompositorShellVisibilityFromFeatures, syncCrosshairLegendToMain, syncOverlayLayersToMain, upgradeIndicatorHostType, widgetKeyForChartPaneType, wrapLayerController };
|
package/dist/index.js
CHANGED
|
@@ -3743,6 +3743,47 @@ function mergeLayoutPreset(current, partial) {
|
|
|
3743
3743
|
});
|
|
3744
3744
|
}
|
|
3745
3745
|
|
|
3746
|
+
// src/layer/layer-bridge-registration.ts
|
|
3747
|
+
function asLayerBridgePreset(p) {
|
|
3748
|
+
return p;
|
|
3749
|
+
}
|
|
3750
|
+
function wrapLayerController(lc) {
|
|
3751
|
+
return {
|
|
3752
|
+
get activePageId() {
|
|
3753
|
+
return lc.activePageId;
|
|
3754
|
+
},
|
|
3755
|
+
get presetRevision() {
|
|
3756
|
+
return lc.presetRevision;
|
|
3757
|
+
},
|
|
3758
|
+
set presetRevision(v) {
|
|
3759
|
+
lc.presetRevision = v;
|
|
3760
|
+
},
|
|
3761
|
+
getPreset: () => asLayerBridgePreset(lc.getPreset()),
|
|
3762
|
+
setLayerSyncGroup: (layerId, groupId) => lc.setLayerSyncGroup(layerId, groupId),
|
|
3763
|
+
setLayerVisible: (layerId, visible) => lc.setLayerVisible(layerId, visible),
|
|
3764
|
+
setActivePage: (pageId) => lc.setActivePage(pageId),
|
|
3765
|
+
setPreset: (next) => lc.setPreset(next)
|
|
3766
|
+
};
|
|
3767
|
+
}
|
|
3768
|
+
function createLayerBridgeRegistration(opts) {
|
|
3769
|
+
const normalizePreset = opts.normalizePreset ?? ((p) => asLayerBridgePreset(normalizeLayoutPreset(p)));
|
|
3770
|
+
const mergePreset = opts.mergePreset ?? ((current, partial) => asLayerBridgePreset(
|
|
3771
|
+
mergeLayoutPreset(
|
|
3772
|
+
current,
|
|
3773
|
+
partial
|
|
3774
|
+
)
|
|
3775
|
+
));
|
|
3776
|
+
return {
|
|
3777
|
+
chartId: opts.chartId,
|
|
3778
|
+
chart: opts.chart,
|
|
3779
|
+
layerController: wrapLayerController(opts.layerController),
|
|
3780
|
+
compositorApply: opts.compositorApply,
|
|
3781
|
+
syncCompositorShellVisibility: opts.syncCompositorShellVisibility,
|
|
3782
|
+
normalizePreset,
|
|
3783
|
+
mergePreset
|
|
3784
|
+
};
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3746
3787
|
// src/layer/resolve-pane-layers.ts
|
|
3747
3788
|
import {
|
|
3748
3789
|
isValidLayerBridgePane,
|
|
@@ -4039,6 +4080,7 @@ export {
|
|
|
4039
4080
|
createCompositorShell,
|
|
4040
4081
|
createDemoLayoutOptions,
|
|
4041
4082
|
createI18nProvider,
|
|
4083
|
+
createLayerBridgeRegistration,
|
|
4042
4084
|
createLayoutGrid,
|
|
4043
4085
|
createSymbolSearchDialog,
|
|
4044
4086
|
createThemeProvider,
|
|
@@ -4108,6 +4150,7 @@ export {
|
|
|
4108
4150
|
syncCrosshairLegendToMain,
|
|
4109
4151
|
syncOverlayLayersToMain,
|
|
4110
4152
|
upgradeIndicatorHostType,
|
|
4111
|
-
widgetKeyForChartPaneType
|
|
4153
|
+
widgetKeyForChartPaneType,
|
|
4154
|
+
wrapLayerController
|
|
4112
4155
|
};
|
|
4113
4156
|
//# sourceMappingURL=index.js.map
|