uiconfig-blueprint 0.1.0-dev.3 → 0.1.0-dev.5
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/UiConfigRendererBlueprint.d.ts +6 -4
- package/dist/allPaths-By_mBgwU.js +23 -0
- package/dist/{allPaths-EtRM6tPk.js.map → allPaths-By_mBgwU.js.map} +1 -1
- package/dist/{allPathsLoader-h6vXUHQy.js → allPathsLoader-DzKtBkYf.js} +5 -5
- package/dist/{allPathsLoader-h6vXUHQy.js.map → allPathsLoader-DzKtBkYf.js.map} +1 -1
- package/dist/bpComponents/BPComponent.d.ts +2 -1
- package/dist/bpComponents/BPFileComponent.d.ts +7 -5
- package/dist/bpComponents/BPFolderComponent.d.ts +1 -0
- package/dist/bpComponents/BPInputComponent.d.ts +2 -1
- package/dist/bpComponents/BPTreeComponent.d.ts +13 -9
- package/dist/bpComponents/BPValueComponent.d.ts +4 -1
- package/dist/components/FileComponent.d.ts +3 -1
- package/dist/components/loadingState.d.ts +4 -0
- package/dist/index-C2vRz8Oc.js +671 -0
- package/dist/index-C2vRz8Oc.js.map +1 -0
- package/dist/index-CIM_EzrF.js +13055 -0
- package/dist/index-CIM_EzrF.js.map +1 -0
- package/dist/index-Dm8yRRlW.js +671 -0
- package/dist/index-Dm8yRRlW.js.map +1 -0
- package/dist/index.js +48 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{splitPathsBySizeLoader-R2EoBNrG.js → splitPathsBySizeLoader-DWtVZ468.js} +6 -6
- package/dist/{splitPathsBySizeLoader-R2EoBNrG.js.map → splitPathsBySizeLoader-DWtVZ468.js.map} +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/UI.html +10 -5
- package/docs/classes/UiConfigRendererBlueprint.html +10 -5
- package/lib/css/renderer.css +21 -4
- package/lib/css/renderer.css.map +1 -1
- package/lib/esm/ConfigObject.js +4 -6
- package/lib/esm/ConfigObject.js.map +1 -1
- package/lib/esm/UiConfigRendererBlueprint.d.ts +6 -4
- package/lib/esm/UiConfigRendererBlueprint.js +7 -5
- package/lib/esm/UiConfigRendererBlueprint.js.map +1 -1
- package/lib/esm/bpComponents/BPButtonComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPColorInputComponent.js +1 -1
- package/lib/esm/bpComponents/BPComponent.d.ts +2 -1
- package/lib/esm/bpComponents/BPComponent.js +12 -1
- package/lib/esm/bpComponents/BPComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPContainerComponent.js +1 -1
- package/lib/esm/bpComponents/BPContainerComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPDropdownInputComponent.js +6 -2
- package/lib/esm/bpComponents/BPDropdownInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFileComponent.d.ts +7 -5
- package/lib/esm/bpComponents/BPFileComponent.js +12 -24
- package/lib/esm/bpComponents/BPFileComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFolderComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPFolderComponent.js +7 -7
- package/lib/esm/bpComponents/BPFolderComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPInputComponent.d.ts +2 -1
- package/lib/esm/bpComponents/BPInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPPanelComponent.js +1 -1
- package/lib/esm/bpComponents/BPPanelComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPSliderInputComponent.js +13 -2
- package/lib/esm/bpComponents/BPSliderInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTreeComponent.d.ts +13 -9
- package/lib/esm/bpComponents/BPTreeComponent.js +104 -23
- package/lib/esm/bpComponents/BPTreeComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPValueComponent.d.ts +4 -1
- package/lib/esm/bpComponents/BPValueComponent.js +19 -3
- package/lib/esm/bpComponents/BPValueComponent.js.map +1 -1
- package/lib/esm/components/DialogContext.js +1 -1
- package/lib/esm/components/DialogContext.js.map +1 -1
- package/lib/esm/components/FileComponent.d.ts +3 -1
- package/lib/esm/components/FileComponent.js +19 -19
- package/lib/esm/components/FileComponent.js.map +1 -1
- package/lib/esm/components/loadingState.d.ts +4 -0
- package/lib/esm/components/loadingState.js +10 -0
- package/lib/esm/components/loadingState.js.map +1 -1
- package/package.json +13 -16
- package/src/ConfigObject.tsx +5 -6
- package/src/UiConfigRendererBlueprint.tsx +9 -8
- package/src/bpComponents/BPButtonComponent.tsx +1 -0
- package/src/bpComponents/BPColorInputComponent.tsx +1 -1
- package/src/bpComponents/BPComponent.tsx +14 -4
- package/src/bpComponents/BPContainerComponent.tsx +2 -1
- package/src/bpComponents/BPDropdownInputComponent.tsx +7 -2
- package/src/bpComponents/BPFileComponent.tsx +41 -25
- package/src/bpComponents/BPFolderComponent.scss +10 -1
- package/src/bpComponents/BPFolderComponent.tsx +9 -5
- package/src/bpComponents/BPInputComponent.tsx +2 -1
- package/src/bpComponents/BPPanelComponent.tsx +1 -1
- package/src/bpComponents/BPSliderInputComponent.tsx +13 -2
- package/src/bpComponents/BPTreeComponent.tsx +99 -20
- package/src/bpComponents/BPValueComponent.tsx +31 -4
- package/src/components/DialogContext.tsx +3 -3
- package/src/components/FileComponent.tsx +48 -25
- package/src/components/loadingState.tsx +9 -0
- package/src/renderer.scss +15 -1
- package/tsconfig.json +1 -0
- package/dist/allPaths-EtRM6tPk.js +0 -23
- package/dist/index-3UEmjC9y.js +0 -13032
- package/dist/index-3UEmjC9y.js.map +0 -1
- package/dist/index-CwuazIjl.js +0 -604
- package/dist/index-CwuazIjl.js.map +0 -1
- package/dist/index-rhJTBxMq.js +0 -604
- package/dist/index-rhJTBxMq.js.map +0 -1
- package/lib/cjs/ConfigObject.d.ts +0 -18
- package/lib/cjs/ConfigObject.js +0 -82
- package/lib/cjs/ConfigObject.js.map +0 -1
- package/lib/cjs/UiConfigRendererBlueprint.d.ts +0 -13
- package/lib/cjs/UiConfigRendererBlueprint.js +0 -56
- package/lib/cjs/UiConfigRendererBlueprint.js.map +0 -1
- package/lib/cjs/bpComponents/BPButtonComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPButtonComponent.js +0 -19
- package/lib/cjs/bpComponents/BPButtonComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPColorInputComponent.d.ts +0 -24
- package/lib/cjs/bpComponents/BPColorInputComponent.js +0 -127
- package/lib/cjs/bpComponents/BPColorInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPComponent.d.ts +0 -29
- package/lib/cjs/bpComponents/BPComponent.js +0 -59
- package/lib/cjs/bpComponents/BPComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPContainerComponent.d.ts +0 -21
- package/lib/cjs/bpComponents/BPContainerComponent.js +0 -54
- package/lib/cjs/bpComponents/BPContainerComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPDropdownInputComponent.d.ts +0 -15
- package/lib/cjs/bpComponents/BPDropdownInputComponent.js +0 -43
- package/lib/cjs/bpComponents/BPDropdownInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPFileComponent.d.ts +0 -25
- package/lib/cjs/bpComponents/BPFileComponent.js +0 -69
- package/lib/cjs/bpComponents/BPFileComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPFolderComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPFolderComponent.js +0 -39
- package/lib/cjs/bpComponents/BPFolderComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPInputComponent.d.ts +0 -11
- package/lib/cjs/bpComponents/BPInputComponent.js +0 -34
- package/lib/cjs/bpComponents/BPInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPLabelledComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPLabelledComponent.js +0 -14
- package/lib/cjs/bpComponents/BPLabelledComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPNumberInputComponent.d.ts +0 -10
- package/lib/cjs/bpComponents/BPNumberInputComponent.js +0 -40
- package/lib/cjs/bpComponents/BPNumberInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPPanelComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPPanelComponent.js +0 -35
- package/lib/cjs/bpComponents/BPPanelComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPSliderInputComponent.d.ts +0 -14
- package/lib/cjs/bpComponents/BPSliderInputComponent.js +0 -41
- package/lib/cjs/bpComponents/BPSliderInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTextInputComponent.d.ts +0 -7
- package/lib/cjs/bpComponents/BPTextInputComponent.js +0 -19
- package/lib/cjs/bpComponents/BPTextInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPToggleInputComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPToggleInputComponent.js +0 -22
- package/lib/cjs/bpComponents/BPToggleInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTreeComponent.d.ts +0 -36
- package/lib/cjs/bpComponents/BPTreeComponent.js +0 -131
- package/lib/cjs/bpComponents/BPTreeComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTreeFolderComponent.d.ts +0 -10
- package/lib/cjs/bpComponents/BPTreeFolderComponent.js +0 -40
- package/lib/cjs/bpComponents/BPTreeFolderComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPValueComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPValueComponent.js +0 -46
- package/lib/cjs/bpComponents/BPValueComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPVectorInputComponent.d.ts +0 -19
- package/lib/cjs/bpComponents/BPVectorInputComponent.js +0 -110
- package/lib/cjs/bpComponents/BPVectorInputComponent.js.map +0 -1
- package/lib/cjs/components/ConfigurationPanelComponent.d.ts +0 -4
- package/lib/cjs/components/ConfigurationPanelComponent.js +0 -30
- package/lib/cjs/components/ConfigurationPanelComponent.js.map +0 -1
- package/lib/cjs/components/DialogContext.d.ts +0 -48
- package/lib/cjs/components/DialogContext.js +0 -79
- package/lib/cjs/components/DialogContext.js.map +0 -1
- package/lib/cjs/components/DraggableIcon.d.ts +0 -19
- package/lib/cjs/components/DraggableIcon.js +0 -70
- package/lib/cjs/components/DraggableIcon.js.map +0 -1
- package/lib/cjs/components/ExtendedNumericInput.d.ts +0 -25
- package/lib/cjs/components/ExtendedNumericInput.js +0 -174
- package/lib/cjs/components/ExtendedNumericInput.js.map +0 -1
- package/lib/cjs/components/FileComponent.d.ts +0 -7
- package/lib/cjs/components/FileComponent.js +0 -49
- package/lib/cjs/components/FileComponent.js.map +0 -1
- package/lib/cjs/components/FormGroupComponent.d.ts +0 -6
- package/lib/cjs/components/FormGroupComponent.js +0 -16
- package/lib/cjs/components/FormGroupComponent.js.map +0 -1
- package/lib/cjs/components/InspectorStackComponent.d.ts +0 -4
- package/lib/cjs/components/InspectorStackComponent.js +0 -27
- package/lib/cjs/components/InspectorStackComponent.js.map +0 -1
- package/lib/cjs/components/VisualStyleContext.d.ts +0 -119
- package/lib/cjs/components/VisualStyleContext.js +0 -60
- package/lib/cjs/components/VisualStyleContext.js.map +0 -1
- package/lib/cjs/components/bpIconWrapper.d.ts +0 -2
- package/lib/cjs/components/bpIconWrapper.js +0 -9
- package/lib/cjs/components/bpIconWrapper.js.map +0 -1
- package/lib/cjs/components/loadingState.d.ts +0 -4
- package/lib/cjs/components/loadingState.js +0 -16
- package/lib/cjs/components/loadingState.js.map +0 -1
- package/lib/cjs/components/variableIcons.d.ts +0 -40
- package/lib/cjs/components/variableIcons.js +0 -46
- package/lib/cjs/components/variableIcons.js.map +0 -1
- package/lib/cjs/contexts.d.ts +0 -1
- package/lib/cjs/contexts.js +0 -3
- package/lib/cjs/contexts.js.map +0 -1
- package/lib/cjs/index.d.ts +0 -4
- package/lib/cjs/index.js +0 -9
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/lib.d.ts +0 -32
- package/lib/cjs/lib.js +0 -49
- package/lib/cjs/lib.js.map +0 -1
- package/lib/cjs/threejs.d.ts +0 -2
- package/lib/cjs/threejs.js +0 -3
- package/lib/cjs/threejs.js.map +0 -1
- package/lib/esnext/ConfigObject.d.ts +0 -18
- package/lib/esnext/ConfigObject.js +0 -75
- package/lib/esnext/ConfigObject.js.map +0 -1
- package/lib/esnext/UiConfigRendererBlueprint.d.ts +0 -13
- package/lib/esnext/UiConfigRendererBlueprint.js +0 -52
- package/lib/esnext/UiConfigRendererBlueprint.js.map +0 -1
- package/lib/esnext/bpComponents/BPButtonComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPButtonComponent.js +0 -15
- package/lib/esnext/bpComponents/BPButtonComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPColorInputComponent.d.ts +0 -24
- package/lib/esnext/bpComponents/BPColorInputComponent.js +0 -110
- package/lib/esnext/bpComponents/BPColorInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPComponent.d.ts +0 -29
- package/lib/esnext/bpComponents/BPComponent.js +0 -46
- package/lib/esnext/bpComponents/BPComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPContainerComponent.d.ts +0 -21
- package/lib/esnext/bpComponents/BPContainerComponent.js +0 -51
- package/lib/esnext/bpComponents/BPContainerComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPDropdownInputComponent.d.ts +0 -15
- package/lib/esnext/bpComponents/BPDropdownInputComponent.js +0 -40
- package/lib/esnext/bpComponents/BPDropdownInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPFileComponent.d.ts +0 -25
- package/lib/esnext/bpComponents/BPFileComponent.js +0 -52
- package/lib/esnext/bpComponents/BPFileComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPFolderComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPFolderComponent.js +0 -30
- package/lib/esnext/bpComponents/BPFolderComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPInputComponent.d.ts +0 -11
- package/lib/esnext/bpComponents/BPInputComponent.js +0 -19
- package/lib/esnext/bpComponents/BPInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPLabelledComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPLabelledComponent.js +0 -13
- package/lib/esnext/bpComponents/BPLabelledComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPNumberInputComponent.d.ts +0 -10
- package/lib/esnext/bpComponents/BPNumberInputComponent.js +0 -21
- package/lib/esnext/bpComponents/BPNumberInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPPanelComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPPanelComponent.js +0 -31
- package/lib/esnext/bpComponents/BPPanelComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPSliderInputComponent.d.ts +0 -14
- package/lib/esnext/bpComponents/BPSliderInputComponent.js +0 -39
- package/lib/esnext/bpComponents/BPSliderInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTextInputComponent.d.ts +0 -7
- package/lib/esnext/bpComponents/BPTextInputComponent.js +0 -15
- package/lib/esnext/bpComponents/BPTextInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPToggleInputComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPToggleInputComponent.js +0 -18
- package/lib/esnext/bpComponents/BPToggleInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTreeComponent.d.ts +0 -36
- package/lib/esnext/bpComponents/BPTreeComponent.js +0 -111
- package/lib/esnext/bpComponents/BPTreeComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTreeFolderComponent.d.ts +0 -10
- package/lib/esnext/bpComponents/BPTreeFolderComponent.js +0 -23
- package/lib/esnext/bpComponents/BPTreeFolderComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPValueComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPValueComponent.js +0 -29
- package/lib/esnext/bpComponents/BPValueComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPVectorInputComponent.d.ts +0 -19
- package/lib/esnext/bpComponents/BPVectorInputComponent.js +0 -93
- package/lib/esnext/bpComponents/BPVectorInputComponent.js.map +0 -1
- package/lib/esnext/components/ConfigurationPanelComponent.d.ts +0 -4
- package/lib/esnext/components/ConfigurationPanelComponent.js +0 -26
- package/lib/esnext/components/ConfigurationPanelComponent.js.map +0 -1
- package/lib/esnext/components/DialogContext.d.ts +0 -48
- package/lib/esnext/components/DialogContext.js +0 -55
- package/lib/esnext/components/DialogContext.js.map +0 -1
- package/lib/esnext/components/DraggableIcon.d.ts +0 -19
- package/lib/esnext/components/DraggableIcon.js +0 -62
- package/lib/esnext/components/DraggableIcon.js.map +0 -1
- package/lib/esnext/components/ExtendedNumericInput.d.ts +0 -25
- package/lib/esnext/components/ExtendedNumericInput.js +0 -151
- package/lib/esnext/components/ExtendedNumericInput.js.map +0 -1
- package/lib/esnext/components/FileComponent.d.ts +0 -7
- package/lib/esnext/components/FileComponent.js +0 -42
- package/lib/esnext/components/FileComponent.js.map +0 -1
- package/lib/esnext/components/FormGroupComponent.d.ts +0 -6
- package/lib/esnext/components/FormGroupComponent.js +0 -11
- package/lib/esnext/components/FormGroupComponent.js.map +0 -1
- package/lib/esnext/components/InspectorStackComponent.d.ts +0 -4
- package/lib/esnext/components/InspectorStackComponent.js +0 -23
- package/lib/esnext/components/InspectorStackComponent.js.map +0 -1
- package/lib/esnext/components/VisualStyleContext.d.ts +0 -119
- package/lib/esnext/components/VisualStyleContext.js +0 -53
- package/lib/esnext/components/VisualStyleContext.js.map +0 -1
- package/lib/esnext/components/bpIconWrapper.d.ts +0 -2
- package/lib/esnext/components/bpIconWrapper.js +0 -5
- package/lib/esnext/components/bpIconWrapper.js.map +0 -1
- package/lib/esnext/components/loadingState.d.ts +0 -4
- package/lib/esnext/components/loadingState.js +0 -12
- package/lib/esnext/components/loadingState.js.map +0 -1
- package/lib/esnext/components/variableIcons.d.ts +0 -40
- package/lib/esnext/components/variableIcons.js +0 -43
- package/lib/esnext/components/variableIcons.js.map +0 -1
- package/lib/esnext/contexts.d.ts +0 -1
- package/lib/esnext/contexts.js +0 -2
- package/lib/esnext/contexts.js.map +0 -1
- package/lib/esnext/index.d.ts +0 -4
- package/lib/esnext/index.js +0 -5
- package/lib/esnext/index.js.map +0 -1
- package/lib/esnext/lib.d.ts +0 -32
- package/lib/esnext/lib.js +0 -33
- package/lib/esnext/lib.js.map +0 -1
- package/lib/esnext/threejs.d.ts +0 -2
- package/lib/esnext/threejs.js +0 -2
- package/lib/esnext/threejs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileComponent.js","sourceRoot":"","sources":["../../../src/components/FileComponent.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FileComponent.js","sourceRoot":"","sources":["../../../src/components/FileComponent.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAA;AAQjD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAC,EAAE;;IACzF,MAAM,YAAY,GAAG,MAAM,EAAoB,CAAA;IAC/C,MAAM,YAAY,GAAG,MAAM,EAAoB,CAAA;IAE/C,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC;QACzC,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC;QACzC,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAA;QACvB,IAAG,CAAC,GAAG,EAAE,CAAC;YACN,WAAW,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,EAAE,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C,CAAC,mCAAI,IAAI,EAAC,CAAC,CAAA;wBAC7E,CAAC,EAAE,SAAS,EAAC,gBAAgB,GAAE,CAC7C,EACA,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,IAAI,CAC/B,KAAC,MAAM,IAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC,aAAa,EACjC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC,GAC1C,CACtB,IACU,IACb,CACT,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -2,3 +2,7 @@ export declare function useLoadingState(): {
|
|
|
2
2
|
loadingState: Record<string, boolean>;
|
|
3
3
|
updateLoading: (key: string, promise?: void | Promise<any> | undefined) => Promise<void>;
|
|
4
4
|
};
|
|
5
|
+
export declare function useLoadingStateKey(): {
|
|
6
|
+
loadingState: boolean;
|
|
7
|
+
updateLoading: (promise?: void | Promise<any> | undefined) => Promise<void>;
|
|
8
|
+
};
|
|
@@ -18,4 +18,14 @@ export function useLoadingState() {
|
|
|
18
18
|
}), [loadingState]);
|
|
19
19
|
return { loadingState, updateLoading };
|
|
20
20
|
}
|
|
21
|
+
export function useLoadingStateKey() {
|
|
22
|
+
const [loadingState, setLoadingState] = useState(false);
|
|
23
|
+
const updateLoading = useCallback((promise) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
if (!promise || promise.then === undefined)
|
|
25
|
+
return setLoadingState(false);
|
|
26
|
+
setLoadingState(true);
|
|
27
|
+
yield promise.then(() => setLoadingState(false));
|
|
28
|
+
}), [loadingState]);
|
|
29
|
+
return { loadingState, updateLoading };
|
|
30
|
+
}
|
|
21
31
|
//# sourceMappingURL=loadingState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadingState.js","sourceRoot":"","sources":["../../../src/components/loadingState.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAE3C,MAAM,UAAU,eAAe;IAC3B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAA;IAC7E,MAAM,aAAa,GAAG,WAAW,CAAC,CAAO,GAAW,EAAE,OAA2B,EAAE,EAAE;QACjF,IAAG,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAE,CAAA;QAClG,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,IAAI,IAAE,CAAA;QAC/C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAE,CAAC,CAAA;IAC9E,CAAC,CAAA,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAClB,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,CAAA;AACxC,CAAC"}
|
|
1
|
+
{"version":3,"file":"loadingState.js","sourceRoot":"","sources":["../../../src/components/loadingState.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAE3C,MAAM,UAAU,eAAe;IAC3B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAA;IAC7E,MAAM,aAAa,GAAG,WAAW,CAAC,CAAO,GAAW,EAAE,OAA2B,EAAE,EAAE;QACjF,IAAG,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAE,CAAA;QAClG,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,IAAI,IAAE,CAAA;QAC/C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,eAAe,iCAAK,YAAY,KAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAE,CAAC,CAAA;IAC9E,CAAC,CAAA,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAClB,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,CAAA;AACxC,CAAC;AACD,MAAM,UAAU,kBAAkB;IAC9B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAA;IAChE,MAAM,aAAa,GAAG,WAAW,CAAC,CAAO,OAA2B,EAAE,EAAE;QACpE,IAAG,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;QACxE,eAAe,CAAC,IAAI,CAAC,CAAA;QACrB,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA;IACpD,CAAC,CAAA,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAClB,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,CAAA;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uiconfig-blueprint",
|
|
3
3
|
"name:umd": "bpui",
|
|
4
|
-
"version": "0.1.0-dev.
|
|
4
|
+
"version": "0.1.0-dev.5",
|
|
5
5
|
"description": "Blueprint.js wrapper and custom components for web controls UI. To be used with uiconfig.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
8
|
+
"browser": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
8
10
|
"source": "src/index.ts",
|
|
9
11
|
"sideEffects": false,
|
|
10
12
|
"files": [
|
|
@@ -35,21 +37,21 @@
|
|
|
35
37
|
},
|
|
36
38
|
"homepage": "https://github.com/repalash/uiconfig-blueprint#readme",
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"ts-browser-helpers": "^0.
|
|
39
|
-
"uiconfig.js": "0.
|
|
40
|
-
"@blueprintjs/icons": "^5.
|
|
41
|
-
"@blueprintjs/select": "^5.
|
|
42
|
-
"blueprint-styler": "^5.0.2"
|
|
40
|
+
"ts-browser-helpers": "^0.16.2",
|
|
41
|
+
"uiconfig.js": "^0.1.2",
|
|
42
|
+
"@blueprintjs/icons": "^5.11.0",
|
|
43
|
+
"@blueprintjs/select": "^5.2.2",
|
|
44
|
+
"blueprint-styler": "^5.0.2",
|
|
45
|
+
"react-colorful": "^5.6.1"
|
|
43
46
|
},
|
|
44
47
|
"peerDependencies": {
|
|
45
|
-
"@blueprintjs/core": "^5.
|
|
48
|
+
"@blueprintjs/core": "^5.11.0",
|
|
46
49
|
"@types/three": "^0.152.1",
|
|
47
50
|
"@types/webxr": "^0.5.10",
|
|
48
51
|
"@types/react": "^18.0.28",
|
|
49
52
|
"@types/react-dom": "^18.0.11",
|
|
50
53
|
"react": "^18.2.0",
|
|
51
|
-
"react-dom": "^18.2.0"
|
|
52
|
-
"react-colorful": "^5.6.1"
|
|
54
|
+
"react-dom": "^18.2.0"
|
|
53
55
|
},
|
|
54
56
|
"peerDependenciesMeta": {
|
|
55
57
|
"@blueprintjs/core": {
|
|
@@ -72,14 +74,11 @@
|
|
|
72
74
|
},
|
|
73
75
|
"react-dom": {
|
|
74
76
|
"optional": true
|
|
75
|
-
},
|
|
76
|
-
"react-colorful": {
|
|
77
|
-
"optional": true
|
|
78
77
|
}
|
|
79
78
|
},
|
|
80
79
|
"//": {
|
|
81
80
|
"devDependencies": {
|
|
82
|
-
"uiconfig.js": "^0.0.
|
|
81
|
+
"uiconfig.js": "^0.0.12"
|
|
83
82
|
},
|
|
84
83
|
"local_dependencies": {
|
|
85
84
|
"uiconfig.js": "file:./../uiconfig/"
|
|
@@ -92,7 +91,5 @@
|
|
|
92
91
|
"browserslist": [
|
|
93
92
|
"defaults"
|
|
94
93
|
],
|
|
95
|
-
"type": "module"
|
|
96
|
-
"browser": "dist/index.js",
|
|
97
|
-
"types": "dist/index.d.ts"
|
|
94
|
+
"type": "module"
|
|
98
95
|
}
|
package/src/ConfigObject.tsx
CHANGED
|
@@ -13,7 +13,6 @@ import {BPPanelComponent} from "./bpComponents/BPPanelComponent";
|
|
|
13
13
|
import {BPTreeFolderComponent} from "./bpComponents/BPTreeFolderComponent";
|
|
14
14
|
import {UiObjectConfig} from 'uiconfig.js'
|
|
15
15
|
import {BPColorInputComponent} from './bpComponents/BPColorInputComponent'
|
|
16
|
-
import {BPFileComponent} from "./bpComponents/BPFileComponent";
|
|
17
16
|
import {BPVectorInputComponent} from './bpComponents/BPVectorInputComponent'
|
|
18
17
|
// import {BPVectorInputComponent} from "./bpComponents/BPVectorInputComponent";
|
|
19
18
|
// import {BPFileComponent} from "./bpComponents/BPFileComponent";
|
|
@@ -44,7 +43,7 @@ export const ConfigObjectGenerators: PartialRecord<UiConfigTypes, Class<React.Co
|
|
|
44
43
|
slider: BPSliderInputComponent,
|
|
45
44
|
tree: BPTreeFolderComponent,
|
|
46
45
|
color: BPColorInputComponent,
|
|
47
|
-
image: BPFileComponent,
|
|
46
|
+
// image: BPFileComponent,
|
|
48
47
|
vec: BPVectorInputComponent,
|
|
49
48
|
vec2: BPVectorInputComponent,
|
|
50
49
|
vec3: BPVectorInputComponent,
|
|
@@ -58,10 +57,10 @@ export class ConfigObject extends React.Component<ConfigProps, {}> {
|
|
|
58
57
|
state = {}
|
|
59
58
|
|
|
60
59
|
render() {
|
|
60
|
+
if (!this.props.config || !this.props.config.type) return (<div key={this.props.config.uuid}></div>)
|
|
61
61
|
this.context.methods.initUiConfig(this.props.config)
|
|
62
|
-
if (!this.props.config.type) return (<div key={this.props.config.uuid}></div>)
|
|
63
62
|
let type = this.props.config.type as any as UiConfigTypes
|
|
64
|
-
const val = this.context.methods.
|
|
63
|
+
const val = this.context.methods.getRawValue(this.props.config)
|
|
65
64
|
|
|
66
65
|
// hacks
|
|
67
66
|
if (type === 'input' && typeof val === 'number') this.props.config.type = type = 'number'
|
|
@@ -81,9 +80,9 @@ export class ConfigObject extends React.Component<ConfigProps, {}> {
|
|
|
81
80
|
return (
|
|
82
81
|
<div key={this.props.config.uuid}>
|
|
83
82
|
<FolderHeadCard
|
|
84
|
-
enabled={enabledToggle ? this.context.methods.
|
|
83
|
+
enabled={enabledToggle ? this.context.methods.getRawValue(enabledToggle) : undefined}
|
|
85
84
|
onEnabledChange={(e) => enabledToggle && this.context.methods.setValue(enabledToggle, e.target.checked, {}).then(() => this.setState(this.state))}
|
|
86
|
-
label={label} minimal={false} open={false} onClick={() => {
|
|
85
|
+
level={0} label={label} minimal={false} open={false} onClick={() => {
|
|
87
86
|
this.props.openPanel<{ config: UiObjectConfig<any> }>({
|
|
88
87
|
props: {config: this.props.config},
|
|
89
88
|
title: label,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {createDiv, createStyles, css} from "ts-browser-helpers";
|
|
2
|
-
import {
|
|
1
|
+
import {createDiv, createStyles, css, JSUndoManager} from "ts-browser-helpers";
|
|
2
|
+
import {UiConfigRenderer, UiObjectConfig} from "uiconfig.js";
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import {createRoot, Root} from 'react-dom/client'
|
|
5
5
|
import {ConfigurationPanelComponent} from './components/ConfigurationPanelComponent'
|
|
@@ -9,13 +9,14 @@ import rendererCss from './renderer.scss?inline' // for rollup build remove ?inl
|
|
|
9
9
|
import {FocusStyleManager} from '@blueprintjs/core'
|
|
10
10
|
import {THREE} from "./threejs";
|
|
11
11
|
|
|
12
|
-
export class UiConfigRendererBlueprint extends
|
|
13
|
-
constructor(container: HTMLElement = document.body, {autoPostFrame = true} = {}) {
|
|
14
|
-
super(container, autoPostFrame);
|
|
12
|
+
export class UiConfigRendererBlueprint extends UiConfigRenderer {
|
|
13
|
+
constructor(container: HTMLElement = document.body, {autoPostFrame = true} = {}, undoManager?: JSUndoManager|false) {
|
|
14
|
+
super(container, autoPostFrame, undefined, undoManager);
|
|
15
15
|
// this._root.expanded = expanded
|
|
16
|
-
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
protected _root: Root
|
|
19
|
+
|
|
19
20
|
protected _createUiContainer(): HTMLDivElement {
|
|
20
21
|
FocusStyleManager.onlyShowFocusOnTabs();
|
|
21
22
|
|
|
@@ -64,8 +65,8 @@ export class UiConfigRendererBlueprint extends UiConfigRendererBase<Root> {
|
|
|
64
65
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
65
66
|
THREE: THREE|undefined = (window as any).THREE
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
unmount() {
|
|
69
|
+
this._root?.unmount()
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
}
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import {BPLabelledComponent, BPLabelledComponentState} from "./BPLabelledComponent";
|
|
4
4
|
import {Button} from "@blueprintjs/core";
|
|
5
5
|
|
|
6
|
+
// @ts-ignore
|
|
6
7
|
export class BPButtonComponent extends BPLabelledComponent<()=>void, BPLabelledComponentState> {
|
|
7
8
|
constructor(props: BPComponentProps<()=>void>, context: UiConfigRendererContextType) {
|
|
8
9
|
super(props, context, {label: 'Button'});
|
|
@@ -20,7 +20,7 @@ export class BPColorInputComponent extends BPValueComponent<ColorRepresentation,
|
|
|
20
20
|
constructor(props: BPComponentProps<ColorRepresentation>, context: UiConfigRendererContextType) {
|
|
21
21
|
super(props, context, {
|
|
22
22
|
label: 'Color',
|
|
23
|
-
value:
|
|
23
|
+
value: '#000000',
|
|
24
24
|
mode: 'number',
|
|
25
25
|
srgbConvert: false,
|
|
26
26
|
});
|
|
@@ -20,7 +20,7 @@ export interface UiConfigRendererBaseBp extends UiConfigRendererBase{
|
|
|
20
20
|
|
|
21
21
|
export const UiConfigRendererContext = createContext<UiConfigRendererBaseBp>(null as any)
|
|
22
22
|
export type UiConfigRendererContextType = React.ContextType<typeof UiConfigRendererContext>
|
|
23
|
-
export abstract class BPComponent<TValue, TState, TProps extends BPComponentProps<TValue> = BPComponentProps<TValue>> extends React.Component<TProps, TState> {
|
|
23
|
+
export abstract class BPComponent<TValue, TState extends BPComponentState, TProps extends BPComponentProps<TValue> = BPComponentProps<TValue>> extends React.Component<TProps, TState> {
|
|
24
24
|
static contextType = UiConfigRendererContext
|
|
25
25
|
declare context: UiConfigRendererContextType
|
|
26
26
|
|
|
@@ -28,6 +28,7 @@ export abstract class BPComponent<TValue, TState, TProps extends BPComponentProp
|
|
|
28
28
|
super(props, context);
|
|
29
29
|
this.state = this.getUpdatedState(state)
|
|
30
30
|
// this.state = state
|
|
31
|
+
this.setState = this.setState.bind(this)
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -38,16 +39,25 @@ export abstract class BPComponent<TValue, TState, TProps extends BPComponentProp
|
|
|
38
39
|
return new Promise<void>(resolve => this.setState(state, resolve))
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
keyVersion = 0
|
|
43
|
+
|
|
41
44
|
/**
|
|
42
45
|
* This is called to get the updated state from the config, copy any values/properties from the config to the state here
|
|
43
46
|
* @param state - the current state
|
|
44
47
|
*/
|
|
45
48
|
getUpdatedState(state: TState): TState{
|
|
49
|
+
const hidden = getOrCall(this.props.config.hidden) ?? false
|
|
50
|
+
const disabled = getOrCall(this.props.config.disabled) ?? false
|
|
51
|
+
const readOnly = getOrCall(this.props.config.readOnly) ?? false
|
|
52
|
+
if(hidden !== state.hidden
|
|
53
|
+
|| disabled !== state.disabled
|
|
54
|
+
|| readOnly !== state.readOnly
|
|
55
|
+
) this.keyVersion++
|
|
46
56
|
return {
|
|
47
57
|
...state,
|
|
48
|
-
hidden
|
|
49
|
-
disabled
|
|
50
|
-
readOnly
|
|
58
|
+
hidden,
|
|
59
|
+
disabled,
|
|
60
|
+
readOnly,
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
63
|
|
|
@@ -16,6 +16,7 @@ export class BPContainerComponent<TState extends BPContainerComponentState=BPCon
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
protected _registerChild(child: UiObjectConfig) {
|
|
19
|
+
// if(Object.keys(child).length)
|
|
19
20
|
child.parentOnChange = this._childParentOnChange
|
|
20
21
|
if(child.property === undefined &&
|
|
21
22
|
child.value === undefined &&
|
|
@@ -28,7 +29,7 @@ export class BPContainerComponent<TState extends BPContainerComponentState=BPCon
|
|
|
28
29
|
|
|
29
30
|
protected _unregisterChild(child: UiObjectConfig) {
|
|
30
31
|
if (child.parentOnChange !== this._childParentOnChange)
|
|
31
|
-
child.parentOnChange
|
|
32
|
+
delete child.parentOnChange
|
|
32
33
|
if(Array.isArray(child.property) &&
|
|
33
34
|
(child.property === this.props.config.property ||
|
|
34
35
|
(child.property[0] === this.props.config &&
|
|
@@ -60,7 +60,12 @@ export class BPDropdownInputComponent extends BPInputComponent<string|number, BP
|
|
|
60
60
|
key={this.props.config.uuid}
|
|
61
61
|
disabled={this.state.disabled}
|
|
62
62
|
popoverProps={{
|
|
63
|
-
minimal: true
|
|
63
|
+
minimal: true,
|
|
64
|
+
}}
|
|
65
|
+
popoverTargetProps={{
|
|
66
|
+
style: {
|
|
67
|
+
height: "100%"
|
|
68
|
+
}
|
|
64
69
|
}}
|
|
65
70
|
noResults={<MenuItem disabled={true} text="No results." roleStructure="listoption" />}
|
|
66
71
|
items={this.state.options}
|
|
@@ -72,7 +77,7 @@ export class BPDropdownInputComponent extends BPInputComponent<string|number, BP
|
|
|
72
77
|
>
|
|
73
78
|
{/* children become the popover target; render value here */}
|
|
74
79
|
<Button rightIcon="double-caret-vertical" small={true}
|
|
75
|
-
style={{whiteSpace: 'nowrap', textOverflow: "ellipsis"}}>{item.label}</Button>
|
|
80
|
+
style={{whiteSpace: 'nowrap', textOverflow: "ellipsis", height: "100%"}}>{item.label}</Button>
|
|
76
81
|
</Select>
|
|
77
82
|
)
|
|
78
83
|
}
|
|
@@ -7,50 +7,56 @@ type StateValue = string | File | null
|
|
|
7
7
|
type FileImportType = any
|
|
8
8
|
export type BPFileComponentState = BPValueComponentState<StateValue> & {
|
|
9
9
|
mode: 'url'|'file',
|
|
10
|
+
preview?: string,
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
type BPFileComponentExtras = {fileLoader?: {load: (v: string|File|{path: string, file: File|Blob})=>Promise<FileImportType>}}
|
|
13
14
|
type BPFileComponentContextType = UiConfigRendererContextType & BPFileComponentExtras
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
export class BPFileComponent<T extends FileImportType=FileImportType, TP = {}> extends BPValueComponent<T | null, BPFileComponentState, StateValue> {
|
|
16
18
|
declare context: BPFileComponentContextType
|
|
17
|
-
declare props: BPComponentProps<
|
|
18
|
-
constructor(props: BPComponentProps<
|
|
19
|
+
declare props: BPComponentProps<T | null> & BPFileComponentExtras & TP
|
|
20
|
+
constructor(props: BPComponentProps<T | null> & BPFileComponentExtras & TP, context: BPFileComponentContextType) {
|
|
19
21
|
super(props, context, {
|
|
20
|
-
mode: '
|
|
22
|
+
mode: 'url',
|
|
21
23
|
value: null,
|
|
22
24
|
label: 'File'
|
|
23
25
|
});
|
|
24
26
|
if(!context.fileLoader && !props.fileLoader) throw new Error('BPFileComponent requires fileLoader to be available in context')
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
29
|
+
// reimplemented in subclass
|
|
30
|
+
convertValueToState(_val: T | null, _state: BPFileComponentState): BPFileComponentState {
|
|
31
|
+
throw new Error('Not Implemented')
|
|
32
|
+
// let mode: BPFileComponentState['mode'] = state.mode
|
|
33
|
+
// let value = state.value
|
|
34
|
+
// if (val) {
|
|
35
|
+
// if (val.userData) {
|
|
36
|
+
// if (val.userData.__sourceBlob) {
|
|
37
|
+
// value = val.userData.__sourceBlob
|
|
38
|
+
// mode = 'file'
|
|
39
|
+
// } else if (val.userData.rootPath?.length) {
|
|
40
|
+
// value = val.userData.rootPath
|
|
41
|
+
// mode = 'url'
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
// }
|
|
45
|
+
// return {...state, mode, value}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
async convertStateToValue(state: BPFileComponentState): Promise<
|
|
48
|
+
async convertStateToValue(state: BPFileComponentState): Promise<T|null> {
|
|
45
49
|
const value = state.value
|
|
46
50
|
let val: any
|
|
51
|
+
const last = this.context.methods.getRawValue(this.props.config as any) ?? null
|
|
52
|
+
const lastState = this.convertValueToState(last as any, {...this.state, value: null})
|
|
47
53
|
if (value === null) {
|
|
48
54
|
val = null
|
|
49
55
|
} else if (typeof value === 'string') {
|
|
50
|
-
val = await (this.context.fileLoader ?? this.props.fileLoader)!.load(value);
|
|
56
|
+
val = value === lastState.value ? last : await (this.context.fileLoader ?? this.props.fileLoader)!.load(value);
|
|
51
57
|
} else {
|
|
52
58
|
// todo handle blob with no name
|
|
53
|
-
val = await (this.context.fileLoader ?? this.props.fileLoader)!.load({path: value.name || 'file', file: value});
|
|
59
|
+
val = value === lastState.value ? last : await (this.context.fileLoader ?? this.props.fileLoader)!.load({path: value.name || 'file', file: value});
|
|
54
60
|
}
|
|
55
61
|
// console.log(val)
|
|
56
62
|
return val;
|
|
@@ -60,12 +66,22 @@ export class BPFileComponent extends BPValueComponent<FileImportType | null, BPF
|
|
|
60
66
|
// return super.doesNeedRefresh(state);
|
|
61
67
|
// }
|
|
62
68
|
|
|
69
|
+
renderPreviewSlot() {
|
|
70
|
+
return <img src={"https://playground.ijewel3d.com/logo_black.png"}
|
|
71
|
+
style={{width: "100%", maxHeight: "80px", objectFit: "contain"}}/>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// async updateStateValue(state: BPFileComponentState, last?: boolean): Promise<void> {
|
|
75
|
+
// if(state.value !== this.state.value && state.preview) delete state.preview
|
|
76
|
+
// return super.updateStateValue(state, last);
|
|
77
|
+
// }
|
|
78
|
+
|
|
63
79
|
render() {
|
|
64
80
|
return !this.state.hidden ? (
|
|
65
81
|
<FormGroupComponent label={this.state.label} flexBasis={"100%"} disabled={this.state.disabled}>
|
|
66
|
-
<FileComponent state={this.state} onChange={(s) =>
|
|
67
|
-
this.updateStateValue({...this.state, ...s})
|
|
68
|
-
}
|
|
82
|
+
<FileComponent previewSlot={this.renderPreviewSlot()} state={this.state} onChange={(s) =>
|
|
83
|
+
this.updateStateValue({...this.state, preview: undefined, ...s}) // todo: set loading while this promise is happening.
|
|
84
|
+
} key={this.props.config.uuid}/>
|
|
69
85
|
</FormGroupComponent>
|
|
70
86
|
) : null
|
|
71
87
|
}
|
|
@@ -58,6 +58,11 @@
|
|
|
58
58
|
&:active {
|
|
59
59
|
background-color: $gray4 !important;
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
.bp5-button-text {
|
|
63
|
+
text-align: left;
|
|
64
|
+
flex: 1 1 auto;
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
.bp5-dark .folder-trigger-button {
|
|
63
68
|
background-color: $dark-gray1 !important;
|
|
@@ -83,7 +88,11 @@
|
|
|
83
88
|
flex-direction: row;
|
|
84
89
|
|
|
85
90
|
> .folder-trigger-button {
|
|
86
|
-
margin-right: $pt-grid-size;
|
|
91
|
+
//margin-right: $pt-grid-size;
|
|
92
|
+
margin-right: 6px;
|
|
93
|
+
//margin-left: $pt-grid-size;
|
|
94
|
+
padding-top: 6px;
|
|
95
|
+
padding-bottom: 6px;
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
|
|
@@ -29,17 +29,18 @@ export class BPFolderComponent extends BPContainerComponent<BPFolderComponentSta
|
|
|
29
29
|
key={this.props.config.uuid}
|
|
30
30
|
open={this.state.expanded}
|
|
31
31
|
disabled={this.state.disabled}
|
|
32
|
+
level={this.props.level ?? 0}
|
|
32
33
|
minimal={(this.props.level ?? 0) > 0}
|
|
33
34
|
onClick={() => {
|
|
34
35
|
if(this.state.readOnly) return
|
|
35
36
|
setExpanded(!this.state.expanded)
|
|
36
37
|
}}
|
|
37
38
|
label={this.state.label}
|
|
38
|
-
enabled={enabledToggle ? this.context.methods.
|
|
39
|
+
enabled={enabledToggle ? this.context.methods.getRawValue(enabledToggle) : undefined}
|
|
39
40
|
onEnabledChange={(e) => enabledToggle && this.context.methods.setValue(enabledToggle, e.target.checked, {}).then(() => this.setState(this.state))}
|
|
40
41
|
>
|
|
41
42
|
<Collapse isOpen={this.state.expanded} keepChildrenMounted={false}>
|
|
42
|
-
<div className="folder-children" style={{listStyleType: "none", paddingLeft: "0
|
|
43
|
+
<div className="folder-children" style={{listStyleType: "none", paddingLeft: this.props.level??0 > 2 ? "6px" : 0}}> {/*todo use parameter instead of const 6*/}
|
|
43
44
|
{this.state.children.map((c, i) => <ConfigObject key={'c' + i} {...this.props} config={c}
|
|
44
45
|
level={(this.props.level ?? 0) + 1}/>)}
|
|
45
46
|
</div>
|
|
@@ -49,7 +50,7 @@ export class BPFolderComponent extends BPContainerComponent<BPFolderComponentSta
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
export const FolderHeadCard: React.FC<React.PropsWithChildren<{ open: boolean, label: string, minimal: boolean, disabled?: boolean, enabled?: boolean, onEnabledChange?: ChangeEventHandler<HTMLInputElement>, onClick: DOMAttributes<HTMLElement>['onClick'] }>> = (props) => {
|
|
53
|
+
export const FolderHeadCard: React.FC<React.PropsWithChildren<{ open: boolean, label: string, minimal: boolean, level: number, disabled?: boolean, enabled?: boolean, onEnabledChange?: ChangeEventHandler<HTMLInputElement>, onClick: DOMAttributes<HTMLElement>['onClick'] }>> = (props) => {
|
|
53
54
|
return (
|
|
54
55
|
<div
|
|
55
56
|
// interactive={!props.open}
|
|
@@ -75,11 +76,14 @@ export const FolderHeadCard: React.FC<React.PropsWithChildren<{ open: boolean, l
|
|
|
75
76
|
{/*</Button>*/}
|
|
76
77
|
|
|
77
78
|
<Button
|
|
78
|
-
className="folder-trigger-button"
|
|
79
|
+
className="folder-trigger-button"
|
|
80
|
+
// fill={!props.minimal}
|
|
81
|
+
fill={true}
|
|
82
|
+
onClick={props.onClick}
|
|
79
83
|
minimal={true}
|
|
80
84
|
disabled={props.disabled}
|
|
81
85
|
small={props.minimal}
|
|
82
|
-
style={props.
|
|
86
|
+
style={props.level ? {marginLeft: "6px"} : {fontSize: "0.95rem", paddingTop: "8px", paddingBottom: "8px"}}
|
|
83
87
|
intent={props.open ? Intent.PRIMARY : Intent.NONE}
|
|
84
88
|
icon={props.enabled !== undefined && <span style={{minWidth: '20px'}}></span>} // adding a span here will center the text in the button
|
|
85
89
|
rightIcon={(
|
|
@@ -2,9 +2,10 @@ import {BPValueComponent, BPValueComponentState} from "./BPValueComponent";
|
|
|
2
2
|
import {BPComponentProps, UiConfigRendererContextType} from "./BPComponent";
|
|
3
3
|
import {ReactNode} from "react";
|
|
4
4
|
import {FormGroupComponent} from "../components/FormGroupComponent";
|
|
5
|
+
import {PrimitiveVal} from "uiconfig.js";
|
|
5
6
|
|
|
6
7
|
export abstract class BPInputComponent<
|
|
7
|
-
TStateValue, TState extends BPValueComponentState<TStateValue> = BPValueComponentState<TStateValue>>
|
|
8
|
+
TStateValue extends PrimitiveVal, TState extends BPValueComponentState<TStateValue> = BPValueComponentState<TStateValue>>
|
|
8
9
|
extends BPValueComponent<TStateValue, TState, TStateValue> {
|
|
9
10
|
|
|
10
11
|
protected constructor(props: BPComponentProps<TStateValue>, context: UiConfigRendererContextType, state: TState) {
|
|
@@ -42,7 +42,7 @@ export class BPPanelComponent extends BPContainerComponent<BPPanelComponentState
|
|
|
42
42
|
<div
|
|
43
43
|
key={this.props.config.uuid}
|
|
44
44
|
className="folder-children" style={{listStyleType: "none", paddingLeft: "0"}}>
|
|
45
|
-
{this.state.children.map((c, i) => <ConfigObject key={'c' + i} {...this.props} config={c}/>)}
|
|
45
|
+
{this.state.children.map((c, i) => c ? <ConfigObject key={'c' + i} {...this.props} config={c}/> : null)}
|
|
46
46
|
</div>
|
|
47
47
|
) : null
|
|
48
48
|
}
|
|
@@ -46,7 +46,11 @@ export class BPSliderInputComponent extends BPInputComponent<number, BPSliderCom
|
|
|
46
46
|
// labelValues={[]}
|
|
47
47
|
onChange={(v) => {
|
|
48
48
|
if(this.state.readOnly) return
|
|
49
|
-
this.setValue(v)
|
|
49
|
+
this.setValue(v, false)
|
|
50
|
+
}}
|
|
51
|
+
onRelease={(v) => {
|
|
52
|
+
if(this.state.readOnly) return
|
|
53
|
+
this.setValue(v, true)
|
|
50
54
|
}}
|
|
51
55
|
/>
|
|
52
56
|
),(
|
|
@@ -63,7 +67,14 @@ export class BPSliderInputComponent extends BPInputComponent<number, BPSliderCom
|
|
|
63
67
|
buttonPosition="none"
|
|
64
68
|
onValueChange={(v) => {
|
|
65
69
|
if(this.state.readOnly) return
|
|
66
|
-
this.setValue(v)
|
|
70
|
+
this.setValue(v, false)
|
|
71
|
+
}}
|
|
72
|
+
onBlur={(e) => {
|
|
73
|
+
if(this.state.readOnly) return
|
|
74
|
+
this.setValue(parseFloat(e.currentTarget.value), true)
|
|
75
|
+
}}
|
|
76
|
+
onKeyDown={(e) => {
|
|
77
|
+
if (e.code === 'Enter') this.setValue(parseFloat(e.currentTarget.value), true)
|
|
67
78
|
}}
|
|
68
79
|
/>)
|
|
69
80
|
]
|