@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.
Files changed (118) hide show
  1. package/browser/routed-app-conventions.ts +1 -1
  2. package/browser/src/common-harness.ts +1 -27
  3. package/browser/src/index.ts +19 -26
  4. package/browser/src/routed-harness.ts +1 -194
  5. package/browser/src/shared-browser.ts +6 -0
  6. package/package.json +23 -13
  7. package/scripts/build.sh +47 -46
  8. package/scripts/framework-host-services.ts +1 -1
  9. package/scripts/generate-host-events.ts +15 -241
  10. package/scripts/generate-host-services.ts +13 -261
  11. package/scripts/hostgen/assemblyscript-host-events.ts +165 -0
  12. package/scripts/hostgen/assemblyscript-host-services.ts +207 -0
  13. package/scripts/hostgen/common.ts +73 -0
  14. package/scripts/hostgen/registry.ts +159 -0
  15. package/src/Fui.ts +65 -5
  16. package/src/FuiExports.ts +12 -1
  17. package/src/bindings/ui.ts +157 -8
  18. package/src/controls/Button.ts +98 -71
  19. package/src/controls/Checkbox.ts +23 -21
  20. package/src/controls/ComboBox.ts +1201 -0
  21. package/src/controls/ContextMenu.ts +279 -165
  22. package/src/controls/Dialog.ts +91 -17
  23. package/src/controls/Dropdown.ts +101 -333
  24. package/src/controls/NavLink.ts +29 -6
  25. package/src/controls/Popup.ts +10 -5
  26. package/src/controls/ProgressBar.ts +1 -2
  27. package/src/controls/RadioButton.ts +34 -13
  28. package/src/controls/RadioGroup.ts +32 -19
  29. package/src/controls/Slider.ts +21 -23
  30. package/src/controls/Switch.ts +34 -17
  31. package/src/controls/index.ts +2 -1
  32. package/src/controls/internal/ButtonPresenter.ts +5 -2
  33. package/src/controls/internal/CheckboxIndicatorPresenter.ts +10 -10
  34. package/src/controls/internal/DropdownChevronPresenter.ts +3 -3
  35. package/src/controls/internal/DropdownFieldPresenter.ts +6 -6
  36. package/src/controls/internal/DropdownOptionRowPresenter.ts +5 -4
  37. package/src/controls/internal/PressableLabeledControl.ts +4 -7
  38. package/src/controls/internal/RadioIndicatorPresenter.ts +7 -7
  39. package/src/controls/internal/SelectablePopupList.ts +463 -0
  40. package/src/controls/internal/SliderPresenter.ts +5 -5
  41. package/src/controls/internal/SwitchIndicatorPresenter.ts +63 -17
  42. package/src/controls/internal/TextInputCore.ts +307 -41
  43. package/src/controls/internal/TextInputPresenter.ts +2 -2
  44. package/src/controls/templating.ts +10 -0
  45. package/src/core/Application.ts +17 -8
  46. package/src/core/Bitmap.ts +192 -3
  47. package/src/core/ContextMenuManager.ts +128 -44
  48. package/src/core/DebugApi.ts +17 -2
  49. package/src/core/DragGesture.ts +8 -7
  50. package/src/core/EventRouter.ts +332 -12
  51. package/src/core/Fetch.ts +15 -7
  52. package/src/core/FetchFfi.ts +1 -15
  53. package/src/core/File.ts +75 -34
  54. package/src/core/FocusAdornerManager.ts +3 -3
  55. package/src/core/FocusVisibility.ts +7 -0
  56. package/src/core/FrameScheduler.ts +104 -5
  57. package/src/core/ImageSampling.ts +43 -0
  58. package/src/core/Logger.ts +2 -0
  59. package/src/core/MobileTextSelectionToolbarManager.ts +901 -0
  60. package/src/core/Node.ts +1039 -97
  61. package/src/core/Platform.ts +16 -16
  62. package/src/core/SelectionHandleAdornerManager.ts +697 -0
  63. package/src/core/Theme.ts +34 -20
  64. package/src/core/ToolTipManager.ts +3 -3
  65. package/src/core/Typography.ts +411 -19
  66. package/src/core/Worker.ts +69 -33
  67. package/src/core/event_exports.ts +123 -5
  68. package/src/core/ffi.ts +5 -865
  69. package/src/core/generated/FetchHostAbi.ts +10 -0
  70. package/src/core/generated/FrameworkHostServices.ts +1 -1
  71. package/src/core/generated/HostAbi.ts +220 -0
  72. package/src/core/generated/UiAbi.ts +356 -0
  73. package/src/core/generated/UiEnums.ts +186 -0
  74. package/src/drawing/DrawCallback.ts +17 -1
  75. package/src/drawing/DrawContext.ts +140 -32
  76. package/src/nodes/CustomDrawable.ts +8 -1
  77. package/src/nodes/FlexBox.ts +40 -11
  78. package/src/nodes/Grid.ts +5 -5
  79. package/src/nodes/Image.ts +20 -1
  80. package/src/nodes/RichText.ts +36 -25
  81. package/src/nodes/ScrollBar.ts +2 -1
  82. package/src/nodes/ScrollBox.ts +7 -2
  83. package/src/nodes/ScrollView.ts +17 -6
  84. package/src/nodes/Svg.ts +18 -1
  85. package/src/nodes/Text.ts +1 -1
  86. package/src/nodes/TextCore.ts +115 -20
  87. package/src/nodes/index.ts +1 -1
  88. package/src/text/DynamicTextLayout.ts +275 -0
  89. package/src/text/TextLayout.ts +308 -0
  90. package/src/worker/Worker.ts +3 -36
  91. package/src/worker/WorkerJob.ts +5 -9
  92. package/src/worker/ffi.ts +0 -6
  93. package/browser/src/common-harness/host-imports.ts +0 -447
  94. package/browser/src/common-harness/interop.ts +0 -39
  95. package/browser/src/common-harness/managed-harness-bitmap-host.ts +0 -92
  96. package/browser/src/common-harness/managed-harness-canvas-host.ts +0 -72
  97. package/browser/src/common-harness/managed-harness-fetch-host.ts +0 -201
  98. package/browser/src/common-harness/managed-harness-file-host.ts +0 -1066
  99. package/browser/src/common-harness/managed-harness-file-payloads.ts +0 -143
  100. package/browser/src/common-harness/managed-harness-file-types.ts +0 -71
  101. package/browser/src/common-harness/managed-harness-session.ts +0 -15
  102. package/browser/src/common-harness/managed-harness.ts +0 -1472
  103. package/browser/src/common-harness/managed-history.ts +0 -168
  104. package/browser/src/common-harness/persisted-restore-policy.ts +0 -50
  105. package/browser/src/common-harness/persisted-ui-state-controller.ts +0 -309
  106. package/browser/src/common-harness/text-session-bridge.ts +0 -452
  107. package/browser/src/common-harness/types.ts +0 -206
  108. package/browser/src/common-harness/ui-chrome.ts +0 -206
  109. package/browser/src/common-harness/ui-imports.ts +0 -559
  110. package/browser/src/common-harness/wasm-module-cache.ts +0 -47
  111. package/browser/src/file-processing-worker.ts +0 -89
  112. package/browser/src/host-events.ts +0 -118
  113. package/browser/src/host-services.ts +0 -483
  114. package/browser/src/persisted-ui-state.ts +0 -206
  115. package/browser/src/routed-app-conventions.ts +0 -292
  116. package/browser/src/worker-bootstrap.ts +0 -916
  117. package/browser/src/worker-manager.ts +0 -234
  118. package/browser/src/worker-types.ts +0 -68
@@ -11,10 +11,10 @@ const detectedPlatformFamily = <PlatformFamily>fui_get_platform_family();
11
11
 
12
12
  class KeyboardPolicy {
13
13
  constructor(
14
- readonly primaryShortcutModifier: u32,
15
- readonly wordNavigationModifier: u32,
16
- readonly lineBoundaryModifier: u32,
17
- readonly documentBoundaryModifier: u32,
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: u32, platformFamily: PlatformFamily): void {
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): u32 {
115
+ export function resolvePrimaryShortcutModifier(platformFamily: PlatformFamily): KeyModifier {
116
116
  return resolveKeyboardPolicy(platformFamily).primaryShortcutModifier;
117
117
  }
118
118
 
119
119
  export function hasPrimaryShortcutModifier(
120
- modifiers: u32,
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): u32 {
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: u32,
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): u32 {
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: u32,
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): u32 {
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: u32,
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: u32,
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: u32,
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: u32,
190
+ modifiers: KeyModifier,
191
191
  platformFamily: PlatformFamily = detectedPlatformFamily,
192
192
  ): string {
193
193
  const tokens = new Array<string>();