@effindomv2/fui-as 0.1.37 → 0.1.39
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/browser/routed-app-conventions.ts +1 -1
- package/browser/src/common-harness.ts +1 -27
- package/browser/src/index.ts +19 -26
- package/browser/src/routed-harness.ts +1 -194
- package/browser/src/shared-browser.ts +6 -0
- package/package.json +23 -13
- package/scripts/build.sh +47 -46
- package/scripts/framework-host-services.ts +1 -1
- package/scripts/generate-host-events.ts +15 -241
- package/scripts/generate-host-services.ts +13 -261
- package/scripts/hostgen/assemblyscript-host-events.ts +165 -0
- package/scripts/hostgen/assemblyscript-host-services.ts +207 -0
- package/scripts/hostgen/common.ts +73 -0
- package/scripts/hostgen/registry.ts +159 -0
- package/src/Fui.ts +65 -5
- package/src/FuiExports.ts +12 -1
- package/src/bindings/ui.ts +157 -8
- package/src/controls/Button.ts +98 -71
- package/src/controls/Checkbox.ts +23 -21
- package/src/controls/ComboBox.ts +1201 -0
- package/src/controls/ContextMenu.ts +279 -165
- package/src/controls/Dialog.ts +91 -17
- package/src/controls/Dropdown.ts +101 -333
- package/src/controls/NavLink.ts +29 -6
- package/src/controls/Popup.ts +10 -5
- package/src/controls/ProgressBar.ts +1 -2
- package/src/controls/RadioButton.ts +34 -13
- package/src/controls/RadioGroup.ts +32 -19
- package/src/controls/Slider.ts +21 -23
- package/src/controls/Switch.ts +34 -17
- package/src/controls/index.ts +2 -1
- package/src/controls/internal/ButtonPresenter.ts +5 -2
- package/src/controls/internal/CheckboxIndicatorPresenter.ts +10 -10
- package/src/controls/internal/DropdownChevronPresenter.ts +3 -3
- package/src/controls/internal/DropdownFieldPresenter.ts +6 -6
- package/src/controls/internal/DropdownOptionRowPresenter.ts +5 -4
- package/src/controls/internal/PressableLabeledControl.ts +4 -7
- package/src/controls/internal/RadioIndicatorPresenter.ts +7 -7
- package/src/controls/internal/SelectablePopupList.ts +463 -0
- package/src/controls/internal/SliderPresenter.ts +5 -5
- package/src/controls/internal/SwitchIndicatorPresenter.ts +63 -17
- package/src/controls/internal/TextInputCore.ts +307 -41
- package/src/controls/internal/TextInputPresenter.ts +2 -2
- package/src/controls/templating.ts +10 -0
- package/src/core/Application.ts +17 -8
- package/src/core/Bitmap.ts +192 -3
- package/src/core/ContextMenuManager.ts +128 -44
- package/src/core/DebugApi.ts +17 -2
- package/src/core/DragGesture.ts +8 -7
- package/src/core/EventRouter.ts +332 -12
- package/src/core/Fetch.ts +15 -7
- package/src/core/FetchFfi.ts +1 -15
- package/src/core/File.ts +75 -34
- package/src/core/FocusAdornerManager.ts +3 -3
- package/src/core/FocusVisibility.ts +7 -0
- package/src/core/FrameScheduler.ts +104 -5
- package/src/core/ImageSampling.ts +43 -0
- package/src/core/Logger.ts +2 -0
- package/src/core/MobileTextSelectionToolbarManager.ts +901 -0
- package/src/core/Node.ts +1039 -97
- package/src/core/Platform.ts +16 -16
- package/src/core/SelectionHandleAdornerManager.ts +697 -0
- package/src/core/Theme.ts +34 -20
- package/src/core/ToolTipManager.ts +3 -3
- package/src/core/Typography.ts +411 -19
- package/src/core/Worker.ts +69 -33
- package/src/core/event_exports.ts +123 -5
- package/src/core/ffi.ts +5 -865
- package/src/core/generated/FetchHostAbi.ts +10 -0
- package/src/core/generated/FrameworkHostServices.ts +1 -1
- package/src/core/generated/HostAbi.ts +220 -0
- package/src/core/generated/UiAbi.ts +356 -0
- package/src/core/generated/UiEnums.ts +186 -0
- package/src/drawing/DrawCallback.ts +17 -1
- package/src/drawing/DrawContext.ts +140 -32
- package/src/nodes/CustomDrawable.ts +8 -1
- package/src/nodes/FlexBox.ts +40 -11
- package/src/nodes/Grid.ts +5 -5
- package/src/nodes/Image.ts +20 -1
- package/src/nodes/RichText.ts +36 -25
- package/src/nodes/ScrollBar.ts +2 -1
- package/src/nodes/ScrollBox.ts +7 -2
- package/src/nodes/ScrollView.ts +17 -6
- package/src/nodes/Svg.ts +18 -1
- package/src/nodes/Text.ts +1 -1
- package/src/nodes/TextCore.ts +115 -20
- package/src/nodes/index.ts +1 -1
- package/src/text/DynamicTextLayout.ts +275 -0
- package/src/text/TextLayout.ts +308 -0
- package/src/worker/Worker.ts +3 -36
- package/src/worker/WorkerJob.ts +5 -9
- package/src/worker/ffi.ts +0 -6
- package/browser/src/common-harness/host-imports.ts +0 -447
- package/browser/src/common-harness/interop.ts +0 -39
- package/browser/src/common-harness/managed-harness-bitmap-host.ts +0 -92
- package/browser/src/common-harness/managed-harness-canvas-host.ts +0 -72
- package/browser/src/common-harness/managed-harness-fetch-host.ts +0 -201
- package/browser/src/common-harness/managed-harness-file-host.ts +0 -1066
- package/browser/src/common-harness/managed-harness-file-payloads.ts +0 -143
- package/browser/src/common-harness/managed-harness-file-types.ts +0 -71
- package/browser/src/common-harness/managed-harness-session.ts +0 -15
- package/browser/src/common-harness/managed-harness.ts +0 -1472
- package/browser/src/common-harness/managed-history.ts +0 -168
- package/browser/src/common-harness/persisted-restore-policy.ts +0 -50
- package/browser/src/common-harness/persisted-ui-state-controller.ts +0 -309
- package/browser/src/common-harness/text-session-bridge.ts +0 -452
- package/browser/src/common-harness/types.ts +0 -206
- package/browser/src/common-harness/ui-chrome.ts +0 -206
- package/browser/src/common-harness/ui-imports.ts +0 -559
- package/browser/src/common-harness/wasm-module-cache.ts +0 -47
- package/browser/src/file-processing-worker.ts +0 -89
- package/browser/src/host-events.ts +0 -118
- package/browser/src/host-services.ts +0 -483
- package/browser/src/persisted-ui-state.ts +0 -206
- package/browser/src/routed-app-conventions.ts +0 -292
- package/browser/src/worker-bootstrap.ts +0 -916
- package/browser/src/worker-manager.ts +0 -234
- package/browser/src/worker-types.ts +0 -68
package/src/core/Platform.ts
CHANGED
|
@@ -11,10 +11,10 @@ const detectedPlatformFamily = <PlatformFamily>fui_get_platform_family();
|
|
|
11
11
|
|
|
12
12
|
class KeyboardPolicy {
|
|
13
13
|
constructor(
|
|
14
|
-
readonly primaryShortcutModifier:
|
|
15
|
-
readonly wordNavigationModifier:
|
|
16
|
-
readonly lineBoundaryModifier:
|
|
17
|
-
readonly documentBoundaryModifier:
|
|
14
|
+
readonly primaryShortcutModifier: KeyModifier,
|
|
15
|
+
readonly wordNavigationModifier: KeyModifier,
|
|
16
|
+
readonly lineBoundaryModifier: KeyModifier,
|
|
17
|
+
readonly documentBoundaryModifier: KeyModifier,
|
|
18
18
|
readonly redoUsesPrimaryY: bool,
|
|
19
19
|
readonly redoUsesShiftedPrimaryZ: bool,
|
|
20
20
|
) {}
|
|
@@ -73,7 +73,7 @@ function formatShortcutKeyToken(key: string, platformFamily: PlatformFamily): st
|
|
|
73
73
|
return key;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function appendShortcutModifierTokens(tokens: Array<string>, modifiers:
|
|
76
|
+
function appendShortcutModifierTokens(tokens: Array<string>, modifiers: KeyModifier, platformFamily: PlatformFamily): void {
|
|
77
77
|
if (platformFamily == PlatformFamily.Apple) {
|
|
78
78
|
if ((modifiers & KeyModifier.Ctrl) != 0) {
|
|
79
79
|
tokens.push("⌃");
|
|
@@ -112,46 +112,46 @@ export function isCoarsePointer(): bool {
|
|
|
112
112
|
return fui_is_coarse_pointer();
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
export function resolvePrimaryShortcutModifier(platformFamily: PlatformFamily):
|
|
115
|
+
export function resolvePrimaryShortcutModifier(platformFamily: PlatformFamily): KeyModifier {
|
|
116
116
|
return resolveKeyboardPolicy(platformFamily).primaryShortcutModifier;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
export function hasPrimaryShortcutModifier(
|
|
120
|
-
modifiers:
|
|
120
|
+
modifiers: KeyModifier,
|
|
121
121
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
122
122
|
): bool {
|
|
123
123
|
return (modifiers & resolvePrimaryShortcutModifier(platformFamily)) != 0;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
export function resolveWordNavigationModifier(platformFamily: PlatformFamily = detectedPlatformFamily):
|
|
126
|
+
export function resolveWordNavigationModifier(platformFamily: PlatformFamily = detectedPlatformFamily): KeyModifier {
|
|
127
127
|
return resolveKeyboardPolicy(platformFamily).wordNavigationModifier;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export function hasWordNavigationModifier(
|
|
131
|
-
modifiers:
|
|
131
|
+
modifiers: KeyModifier,
|
|
132
132
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
133
133
|
): bool {
|
|
134
134
|
return (modifiers & resolveWordNavigationModifier(platformFamily)) != 0;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
export function resolveLineBoundaryModifier(platformFamily: PlatformFamily = detectedPlatformFamily):
|
|
137
|
+
export function resolveLineBoundaryModifier(platformFamily: PlatformFamily = detectedPlatformFamily): KeyModifier {
|
|
138
138
|
return resolveKeyboardPolicy(platformFamily).lineBoundaryModifier;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export function hasLineBoundaryModifier(
|
|
142
|
-
modifiers:
|
|
142
|
+
modifiers: KeyModifier,
|
|
143
143
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
144
144
|
): bool {
|
|
145
145
|
const modifier = resolveLineBoundaryModifier(platformFamily);
|
|
146
146
|
return modifier != 0 && (modifiers & modifier) != 0;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export function resolveDocumentBoundaryModifier(platformFamily: PlatformFamily = detectedPlatformFamily):
|
|
149
|
+
export function resolveDocumentBoundaryModifier(platformFamily: PlatformFamily = detectedPlatformFamily): KeyModifier {
|
|
150
150
|
return resolveKeyboardPolicy(platformFamily).documentBoundaryModifier;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
export function hasDocumentBoundaryModifier(
|
|
154
|
-
modifiers:
|
|
154
|
+
modifiers: KeyModifier,
|
|
155
155
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
156
156
|
): bool {
|
|
157
157
|
return (modifiers & resolveDocumentBoundaryModifier(platformFamily)) != 0;
|
|
@@ -159,7 +159,7 @@ export function hasDocumentBoundaryModifier(
|
|
|
159
159
|
|
|
160
160
|
export function isUndoShortcut(
|
|
161
161
|
key: string,
|
|
162
|
-
modifiers:
|
|
162
|
+
modifiers: KeyModifier,
|
|
163
163
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
164
164
|
): bool {
|
|
165
165
|
return (modifiers & KeyModifier.Shift) == 0 &&
|
|
@@ -169,7 +169,7 @@ export function isUndoShortcut(
|
|
|
169
169
|
|
|
170
170
|
export function isRedoShortcut(
|
|
171
171
|
key: string,
|
|
172
|
-
modifiers:
|
|
172
|
+
modifiers: KeyModifier,
|
|
173
173
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
174
174
|
): bool {
|
|
175
175
|
const policy = resolveKeyboardPolicy(platformFamily);
|
|
@@ -187,7 +187,7 @@ export function isRedoShortcut(
|
|
|
187
187
|
|
|
188
188
|
export function formatShortcutLabel(
|
|
189
189
|
key: string,
|
|
190
|
-
modifiers:
|
|
190
|
+
modifiers: KeyModifier,
|
|
191
191
|
platformFamily: PlatformFamily = detectedPlatformFamily,
|
|
192
192
|
): string {
|
|
193
193
|
const tokens = new Array<string>();
|