@platforma-sdk/ui-vue 1.82.6 → 1.83.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.
Files changed (141) hide show
  1. package/.turbo/turbo-build.log +169 -23
  2. package/.turbo/turbo-formatter$colon$check.log +2 -2
  3. package/.turbo/turbo-linter$colon$check.log +2 -2
  4. package/.turbo/turbo-types$colon$check.log +2 -2
  5. package/CHANGELOG.md +62 -0
  6. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +1 -1
  7. package/dist/components/PlAgDataTable/compositions/useFilterableColumns.d.ts +16 -16
  8. package/dist/components/PlAnnotations/components/AnnotationsSidebar.js.map +1 -1
  9. package/dist/components/PlAnnotations/components/AnnotationsSidebar.style.js.map +1 -1
  10. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +1 -1
  11. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
  12. package/dist/components/PlAnnotations/components/FilterSidebar.js.map +1 -1
  13. package/dist/components/PlAnnotations/components/FilterSidebar.style.js.map +1 -1
  14. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +1 -1
  15. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
  16. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
  17. package/dist/defineApp.d.ts +2 -32
  18. package/dist/defineApp.d.ts.map +1 -1
  19. package/dist/defineApp.js +20 -62
  20. package/dist/defineApp.js.map +1 -1
  21. package/dist/index.js +39 -39
  22. package/dist/internal/createAppV3.d.ts +1 -1
  23. package/dist/internal/createAppV3.js +16 -16
  24. package/dist/lib/util/helpers/dist/utils.js +2 -5
  25. package/dist/lib/util/helpers/dist/utils.js.map +1 -1
  26. package/dist/lib.js +1 -1
  27. package/package.json +8 -8
  28. package/src/components/PlAnnotations/components/AnnotationsSidebar.vue +2 -2
  29. package/src/components/PlAnnotations/components/FilterSidebar.vue +2 -2
  30. package/src/defineApp.ts +1 -183
  31. package/dist/components/BlockLayout.vue.d.ts +0 -3
  32. package/dist/components/BlockLayout.vue.d.ts.map +0 -1
  33. package/dist/components/BlockLoader.vue.d.ts +0 -6
  34. package/dist/components/BlockLoader.vue.d.ts.map +0 -1
  35. package/dist/components/LoaderPage.vue.d.ts +0 -3
  36. package/dist/components/LoaderPage.vue.d.ts.map +0 -1
  37. package/dist/components/NotFound.vue.d.ts +0 -3
  38. package/dist/components/NotFound.vue.d.ts.map +0 -1
  39. package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts +0 -23
  40. package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts.map +0 -1
  41. package/dist/components/PlAdvancedFilter/OperandButton.vue.d.ts +0 -9
  42. package/dist/components/PlAdvancedFilter/OperandButton.vue.d.ts.map +0 -1
  43. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts +0 -55
  44. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts.map +0 -1
  45. package/dist/components/PlAgCellFile/PlAgCellFile.vue.d.ts +0 -26
  46. package/dist/components/PlAgCellFile/PlAgCellFile.vue.d.ts.map +0 -1
  47. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue.d.ts +0 -8
  48. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue.d.ts.map +0 -1
  49. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue.d.ts +0 -10
  50. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue.d.ts.map +0 -1
  51. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue.d.ts +0 -11
  52. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue.d.ts.map +0 -1
  53. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue.d.ts +0 -8
  54. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue.d.ts.map +0 -1
  55. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.d.ts +0 -10
  56. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.d.ts.map +0 -1
  57. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.d.ts +0 -10
  58. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.d.ts.map +0 -1
  59. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue.d.ts +0 -31
  60. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue.d.ts.map +0 -1
  61. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts +0 -94
  62. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +0 -1
  63. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue.d.ts +0 -10
  64. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue.d.ts.map +0 -1
  65. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue.d.ts +0 -9
  66. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue.d.ts.map +0 -1
  67. package/dist/components/PlAgDataTable/PlAgRowCount.vue.d.ts +0 -9
  68. package/dist/components/PlAgDataTable/PlAgRowCount.vue.d.ts.map +0 -1
  69. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts +0 -17
  70. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts.map +0 -1
  71. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.d.ts +0 -7
  72. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.d.ts.map +0 -1
  73. package/dist/components/PlAgRowNumHeader.vue.d.ts +0 -7
  74. package/dist/components/PlAgRowNumHeader.vue.d.ts.map +0 -1
  75. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue.d.ts +0 -32
  76. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue.d.ts.map +0 -1
  77. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.d.ts +0 -14
  78. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.d.ts.map +0 -1
  79. package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts +0 -26
  80. package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts.map +0 -1
  81. package/dist/components/PlAnnotations/components/PlAnnotations.vue.d.ts +0 -10
  82. package/dist/components/PlAnnotations/components/PlAnnotations.vue.d.ts.map +0 -1
  83. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.d.ts +0 -8
  84. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue.d.ts.map +0 -1
  85. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue.d.ts +0 -11
  86. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue.d.ts.map +0 -1
  87. package/dist/components/PlBtnExportArchive/Item.vue.d.ts +0 -7
  88. package/dist/components/PlBtnExportArchive/Item.vue.d.ts.map +0 -1
  89. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue.d.ts +0 -35
  90. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue.d.ts.map +0 -1
  91. package/dist/components/PlBtnExportArchive/Summary.vue.d.ts +0 -11
  92. package/dist/components/PlBtnExportArchive/Summary.vue.d.ts.map +0 -1
  93. package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts +0 -77
  94. package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts.map +0 -1
  95. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue.d.ts +0 -10
  96. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue.d.ts.map +0 -1
  97. package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts +0 -14
  98. package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts.map +0 -1
  99. package/dist/internal/createAppModel.d.ts +0 -7
  100. package/dist/internal/createAppModel.d.ts.map +0 -1
  101. package/dist/internal/createAppModel.js +0 -57
  102. package/dist/internal/createAppModel.js.map +0 -1
  103. package/dist/internal/createAppV1.d.ts +0 -53
  104. package/dist/internal/createAppV1.d.ts.map +0 -1
  105. package/dist/internal/createAppV1.js +0 -129
  106. package/dist/internal/createAppV1.js.map +0 -1
  107. package/dist/internal/createAppV2.d.ts +0 -50
  108. package/dist/internal/createAppV2.d.ts.map +0 -1
  109. package/dist/internal/createAppV2.js +0 -137
  110. package/dist/internal/createAppV2.js.map +0 -1
  111. package/dist/internal/createAppV2.test.d.ts +0 -15
  112. package/dist/internal/createAppV2.test.d.ts.map +0 -1
  113. package/dist/internal/test-helpers/BlockMock.d.ts +0 -29
  114. package/dist/internal/test-helpers/BlockMock.d.ts.map +0 -1
  115. package/dist/internal/test-helpers/createMockApi.d.ts +0 -4
  116. package/dist/internal/test-helpers/createMockApi.d.ts.map +0 -1
  117. package/dist/internal/test-helpers/utils.d.ts +0 -4
  118. package/dist/internal/test-helpers/utils.d.ts.map +0 -1
  119. package/dist/internal/v1.static-test.d.ts +0 -7
  120. package/dist/internal/v1.static-test.d.ts.map +0 -1
  121. package/dist/internal/v2.static-test.d.ts +0 -7
  122. package/dist/internal/v2.static-test.d.ts.map +0 -1
  123. package/dist/plugins/Monetization/EndOfPeriod.vue.d.ts +0 -6
  124. package/dist/plugins/Monetization/EndOfPeriod.vue.d.ts.map +0 -1
  125. package/dist/plugins/Monetization/LimitCard.vue.d.ts +0 -11
  126. package/dist/plugins/Monetization/LimitCard.vue.d.ts.map +0 -1
  127. package/dist/plugins/Monetization/MonetizationSidebar.vue.d.ts +0 -3
  128. package/dist/plugins/Monetization/MonetizationSidebar.vue.d.ts.map +0 -1
  129. package/dist/plugins/Monetization/RunStatus.vue.d.ts +0 -23
  130. package/dist/plugins/Monetization/RunStatus.vue.d.ts.map +0 -1
  131. package/dist/plugins/Monetization/UserCabinetCard.vue.d.ts +0 -7
  132. package/dist/plugins/Monetization/UserCabinetCard.vue.d.ts.map +0 -1
  133. package/src/internal/createAppModel.ts +0 -112
  134. package/src/internal/createAppV1.ts +0 -324
  135. package/src/internal/createAppV2.test.ts +0 -207
  136. package/src/internal/createAppV2.ts +0 -392
  137. package/src/internal/test-helpers/BlockMock.ts +0 -161
  138. package/src/internal/test-helpers/createMockApi.ts +0 -104
  139. package/src/internal/test-helpers/utils.ts +0 -65
  140. package/src/internal/v1.static-test.ts +0 -107
  141. package/src/internal/v2.static-test.ts +0 -107
@@ -1,4 +0,0 @@
1
- import { BlockOutputsBase, PlatformaV2 } from '@platforma-sdk/model';
2
- import { BlockMock } from './BlockMock';
3
- export declare function createMockApi<Args, Outputs extends BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`>(block: BlockMock<Args, Outputs, UiState, Href>): PlatformaV2<Args, Outputs, UiState, Href>;
4
- //# sourceMappingURL=createMockApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMockApi.d.ts","sourceRoot":"","sources":["../../../src/internal/test-helpers/createMockApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,gBAAgB,EAUhB,WAAW,EAKZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,wBAAgB,aAAa,CAC3B,IAAI,EACJ,OAAO,SAAS,gBAAgB,EAChC,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,EACxC,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CA2E3F"}
@@ -1,4 +0,0 @@
1
- import { ListFilesResult } from '@platforma-sdk/model';
2
- export declare const capitalizeFirstLetter: (str: string) => string;
3
- export declare const getLsFilesResult: (path: string) => ListFilesResult;
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/internal/test-helpers/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA0B,eAAe,EAAW,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,WAEhD,CAAC;AAIF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,eAsD/C,CAAC"}
@@ -1,7 +0,0 @@
1
- import { BlockOutputsBase, InferHrefType, InferOutputsType, Platforma } from '@platforma-sdk/model';
2
- import { createAppV1 } from './createAppV1';
3
- type InferArgs<Pl extends Platforma> = Pl extends Platforma<infer Args> ? Args : never;
4
- type InferUiState<Pl extends Platforma> = Pl extends Platforma<unknown, BlockOutputsBase, infer UiState> ? UiState : never;
5
- export type TestApp<P extends Platforma> = ReturnType<typeof createAppV1<InferArgs<P>, InferOutputsType<P>, InferUiState<P>, InferHrefType<P>>>;
6
- export {};
7
- //# sourceMappingURL=v1.static-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.static-test.d.ts","sourceRoot":"","sources":["../../src/internal/v1.static-test.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEhB,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,eAAe,CAAC;AAoC5D,KAAK,SAAS,CAAC,EAAE,SAAS,SAAS,IAAI,EAAE,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACvF,KAAK,YAAY,CAAC,EAAE,SAAS,SAAS,IACpC,EAAE,SAAS,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,SAAS,IAAI,UAAU,CACnD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CACzF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { BlockOutputsBase, InferHrefType, InferOutputsType, Platforma } from '@platforma-sdk/model';
2
- import { createAppV2 } from './createAppV2';
3
- type InferArgs<Pl extends Platforma> = Pl extends Platforma<infer Args> ? Args : never;
4
- type InferUiState<Pl extends Platforma> = Pl extends Platforma<unknown, BlockOutputsBase, infer UiState> ? UiState : never;
5
- export type TestApp<P extends Platforma> = ReturnType<typeof createAppV2<InferArgs<P>, InferOutputsType<P>, InferUiState<P>, InferHrefType<P>>>;
6
- export {};
7
- //# sourceMappingURL=v2.static-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v2.static-test.d.ts","sourceRoot":"","sources":["../../src/internal/v2.static-test.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEhB,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,eAAe,CAAC;AAoC5D,KAAK,SAAS,CAAC,EAAE,SAAS,SAAS,IAAI,EAAE,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACvF,KAAK,YAAY,CAAC,EAAE,SAAS,SAAS,IACpC,EAAE,SAAS,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,SAAS,IAAI,UAAU,CACnD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CACzF,CAAC"}
@@ -1,6 +0,0 @@
1
- type __VLS_Props = {
2
- endOfPeriod: string | null;
3
- };
4
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
5
- export default _default;
6
- //# sourceMappingURL=EndOfPeriod.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EndOfPeriod.vue.d.ts","sourceRoot":"","sources":["../../../src/plugins/Monetization/EndOfPeriod.vue"],"names":[],"mappings":"AA6CA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;;AA2DF,wBAOG"}
@@ -1,11 +0,0 @@
1
- type __VLS_Props = {
2
- type: "unique_launches" | "volume_limit";
3
- label: string;
4
- used: number;
5
- toSpend: number;
6
- available: number | null;
7
- unit?: string;
8
- };
9
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
10
- export default _default;
11
- //# sourceMappingURL=LimitCard.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LimitCard.vue.d.ts","sourceRoot":"","sources":["../../../src/plugins/Monetization/LimitCard.vue"],"names":[],"mappings":"AA6PA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,iBAAiB,GAAG,cAAc,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;AA8LF,wBAOG"}
@@ -1,3 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
- export default _default;
3
- //# sourceMappingURL=MonetizationSidebar.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MonetizationSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/plugins/Monetization/MonetizationSidebar.vue"],"names":[],"mappings":";AAycA,wBAKG"}
@@ -1,23 +0,0 @@
1
- type __VLS_Props = {
2
- canRun: boolean | undefined;
3
- statusText: string | undefined;
4
- isLoading?: boolean;
5
- };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: {
9
- default?(_: {}): any;
10
- };
11
- refs: {};
12
- rootEl: HTMLDivElement;
13
- };
14
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
16
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
- export default _default;
18
- type __VLS_WithTemplateSlots<T, S> = T & {
19
- new (): {
20
- $slots: S;
21
- };
22
- };
23
- //# sourceMappingURL=RunStatus.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RunStatus.vue.d.ts","sourceRoot":"","sources":["../../../src/plugins/Monetization/RunStatus.vue"],"names":[],"mappings":"AA8GA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAiBF,iBAAS,cAAc;WAkDT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAkBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- type __VLS_Props = {
2
- userCabinetUrl: string;
3
- email?: string;
4
- };
5
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
6
- export default _default;
7
- //# sourceMappingURL=UserCabinetCard.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserCabinetCard.vue.d.ts","sourceRoot":"","sources":["../../../src/plugins/Monetization/UserCabinetCard.vue"],"names":[],"mappings":"AA+HA,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;;AA4IF,wBAOG"}
@@ -1,112 +0,0 @@
1
- import {
2
- reactive,
3
- computed,
4
- ref,
5
- watch,
6
- unref,
7
- type ComputedRef,
8
- type UnwrapNestedRefs,
9
- } from "vue";
10
- import type { ModelOptions, Model, AppSettings } from "../types";
11
- import { deepClone, isJsonEqual } from "@milaboratories/helpers";
12
- import { identity, ensureError, isZodError, formatZodError } from "../utils";
13
-
14
- export function createAppModel<
15
- M extends { args: unknown; ui: unknown },
16
- V = unknown,
17
- E extends Record<string, ComputedRef<unknown>> = Record<string, ComputedRef<unknown>>,
18
- >(
19
- options: ModelOptions<M, V>,
20
- extended: E,
21
- _settings: AppSettings,
22
- ): Model<M & UnwrapNestedRefs<E>> {
23
- type R = M & UnwrapNestedRefs<E>;
24
-
25
- const validate = options.validate ?? identity;
26
-
27
- const { autoSave } = options;
28
-
29
- const error = ref<Error | undefined>();
30
-
31
- const local = ref<{ model: R; readonly stage: symbol }>();
32
-
33
- const setSource = (v: M) => {
34
- local.value = {
35
- model: Object.assign(deepClone(v), extended ?? {}) as R,
36
- stage: Symbol(),
37
- };
38
- };
39
-
40
- watch(
41
- () => options.get(),
42
- (v) => setSource(v),
43
- { immediate: true },
44
- );
45
-
46
- const save = () => options.onSave(validate(deepClone(local.value?.model)));
47
-
48
- const revert = () => {
49
- setSource(options.get());
50
- error.value = undefined;
51
- };
52
-
53
- const setError = (cause: unknown) => {
54
- const err = ensureError(cause);
55
- if (isZodError(err)) {
56
- error.value = Error(formatZodError(err)); // @todo temp
57
- } else {
58
- error.value = err;
59
- }
60
- };
61
-
62
- const setValue = (v: M) => {
63
- error.value = undefined;
64
- try {
65
- validate(v);
66
- if (autoSave) {
67
- save();
68
- }
69
- } catch (cause: unknown) {
70
- setError(cause);
71
- }
72
- };
73
-
74
- const model = computed<R>({
75
- get: () => {
76
- return local.value?.model as R;
77
- },
78
- set() {
79
- throw Error("Cannot replace base model");
80
- },
81
- });
82
-
83
- watch(
84
- [() => ({ args: model.value.args, ui: model.value.ui }), () => local.value?.stage],
85
- ([n, newStage], [_, oldStage]) => {
86
- if (newStage === oldStage) {
87
- setValue(n as M);
88
- }
89
- },
90
- { deep: true },
91
- );
92
-
93
- const valid = computed(() => !error.value);
94
-
95
- const isChanged = computed(() => {
96
- const { args, ui } = unref(local)?.model ?? {};
97
- return !isJsonEqual(options.get(), { args, ui });
98
- });
99
-
100
- const errorString = computed(() => (error.value ? error.value.message : ""));
101
-
102
- return reactive({
103
- model,
104
- valid,
105
- isChanged,
106
- error,
107
- errorString,
108
- save,
109
- revert,
110
- setError,
111
- });
112
- }
@@ -1,324 +0,0 @@
1
- import { deepClone, isJsonEqual, tap } from "@milaboratories/helpers";
2
- import type { Mutable } from "@milaboratories/helpers";
3
- import type {
4
- NavigationState,
5
- BlockOutputsBase,
6
- BlockState,
7
- PlatformaV1,
8
- PlatformaExtended,
9
- } from "@platforma-sdk/model";
10
- import { reactive, nextTick, computed, watch } from "vue";
11
- import type {
12
- StateModelOptions,
13
- UnwrapOutputs,
14
- OptionalResult,
15
- OutputValues,
16
- OutputErrors,
17
- AppSettings,
18
- } from "../types";
19
- import { createModel } from "../createModel";
20
- import { createAppModel } from "./createAppModel";
21
- import { parseQuery } from "../urls";
22
- import { ensureOutputHasStableFlag, MultiError, unwrapOutput } from "../utils";
23
- import { useDebounceFn } from "@vueuse/core";
24
- /**
25
- * Creates an application instance with reactive state management, outputs, and methods for state updates and navigation.
26
- *
27
- * @template Args - The type of arguments used in the application.
28
- * @template Outputs - The type of block outputs extending `BlockOutputsBase`.
29
- * @template UiState - The type of the UI state.
30
- * @template Href - The type of navigation href, defaulting to a string starting with `/`.
31
- *
32
- * @param state - Initial state of the application, including args, outputs, UI state, and navigation state.
33
- * @param platforma - A platform interface for interacting with block states.
34
- * @param settings - Application settings, such as debug flags.
35
- *
36
- * @returns A reactive application object with methods, getters, and state.
37
- */
38
- export function createAppV1<
39
- Args = unknown,
40
- Outputs extends BlockOutputsBase = BlockOutputsBase,
41
- UiState = unknown,
42
- Href extends `/${string}` = `/${string}`,
43
- >(
44
- state: BlockState<Args, Outputs, UiState, Href>,
45
- platforma: PlatformaExtended<PlatformaV1<Args, Outputs, UiState, Href>>,
46
- settings: AppSettings,
47
- ) {
48
- type AppModel = {
49
- args: Args;
50
- ui: UiState;
51
- };
52
-
53
- const log = (msg: string, ...rest: unknown[]) => {
54
- if (settings.debug) {
55
- console.log(`%c>>> %c${msg}`, "color: orange; font-weight: bold", "color: orange", ...rest);
56
- }
57
- };
58
-
59
- /**
60
- * Reactive snapshot of the application state, including args, outputs, UI state, and navigation state.
61
- */
62
- const snapshot = reactive({
63
- args: Object.freeze(state.args),
64
- outputs: Object.freeze(state.outputs),
65
- ui: Object.freeze(state.ui),
66
- navigationState: Object.freeze(state.navigationState) as NavigationState<Href>,
67
- }) as {
68
- args: Readonly<Args>;
69
- outputs: Partial<Readonly<Outputs>>;
70
- ui: Readonly<UiState>;
71
- navigationState: Readonly<NavigationState<Href>>;
72
- };
73
-
74
- const debounceSpan = settings.debounceSpan ?? 200;
75
-
76
- const maxWait = tap(settings.debounceMaxWait ?? 0, (v) =>
77
- v < 20_000 ? 20_000 : v < debounceSpan ? debounceSpan * 100 : v,
78
- );
79
-
80
- const setBlockArgs = useDebounceFn(
81
- (args: Args) => {
82
- if (!isJsonEqual(args, snapshot.args)) {
83
- platforma.setBlockArgs(args);
84
- }
85
- },
86
- debounceSpan,
87
- { maxWait },
88
- );
89
-
90
- const setBlockUiState = useDebounceFn(
91
- (ui: UiState) => {
92
- if (!isJsonEqual(ui, snapshot.ui)) {
93
- platforma.setBlockUiState(ui);
94
- }
95
- },
96
- debounceSpan,
97
- { maxWait },
98
- );
99
-
100
- const setBlockArgsAndUiState = useDebounceFn(
101
- (args: Args, ui: UiState) => {
102
- if (!isJsonEqual(args, snapshot.args) || !isJsonEqual(ui, snapshot.ui)) {
103
- platforma.setBlockArgsAndUiState(args, ui);
104
- }
105
- },
106
- debounceSpan,
107
- { maxWait },
108
- );
109
-
110
- (platforma as PlatformaV1<Args, Outputs, UiState, Href>).onStateUpdates(async (updates) => {
111
- updates.forEach((patch) => {
112
- if (patch.key === "args" && !isJsonEqual(snapshot.args, patch.value)) {
113
- snapshot.args = Object.freeze(patch.value);
114
- log("args patch", snapshot.args);
115
- }
116
-
117
- if (patch.key === "ui" && !isJsonEqual(snapshot.ui, patch.value)) {
118
- snapshot.ui = Object.freeze(patch.value);
119
- log("ui patch", snapshot.ui);
120
- }
121
-
122
- if (patch.key === "outputs" && !isJsonEqual(snapshot.outputs, patch.value)) {
123
- snapshot.outputs = Object.freeze(patch.value);
124
- log("outputs patch", snapshot.outputs);
125
- }
126
-
127
- if (patch.key === "navigationState" && !isJsonEqual(snapshot.navigationState, patch.value)) {
128
- snapshot.navigationState = Object.freeze(patch.value);
129
- log("navigationState patch", snapshot.navigationState);
130
- }
131
- });
132
-
133
- await nextTick();
134
- });
135
-
136
- const cloneArgs = () => deepClone(snapshot.args) as Args;
137
- const cloneUiState = () => deepClone(snapshot.ui) as UiState;
138
- const cloneNavigationState = () =>
139
- deepClone(snapshot.navigationState) as Mutable<NavigationState<Href>>;
140
-
141
- const methods = {
142
- createArgsModel<T = Args>(options: StateModelOptions<Args, T> = {}) {
143
- return createModel<T, Args>({
144
- get() {
145
- if (options.transform) {
146
- return options.transform(snapshot.args);
147
- }
148
-
149
- return snapshot.args as T;
150
- },
151
- validate: options.validate,
152
- autoSave: true,
153
- onSave(newArgs) {
154
- setBlockArgs(newArgs);
155
- },
156
- });
157
- },
158
- /**
159
- * defaultUiState is temporarily here, remove it after implementing initialUiState
160
- */
161
- createUiModel<T = UiState>(
162
- options: StateModelOptions<UiState, T> = {},
163
- defaultUiState: () => UiState,
164
- ) {
165
- return createModel<T, UiState>({
166
- get() {
167
- if (options.transform) {
168
- return options.transform(snapshot.ui);
169
- }
170
-
171
- return (snapshot.ui ?? defaultUiState()) as T;
172
- },
173
- validate: options.validate,
174
- autoSave: true,
175
- onSave(newData) {
176
- setBlockUiState(newData);
177
- },
178
- });
179
- },
180
- /**
181
- * Note: Don't forget to list the output names, like: useOutputs('output1', 'output2', ...etc)
182
- * @param keys - List of output names
183
- * @returns {OptionalResult<UnwrapOutputs<Outputs, K>>}
184
- */
185
- useOutputs<K extends keyof Outputs>(...keys: K[]): OptionalResult<UnwrapOutputs<Outputs, K>> {
186
- const data = reactive({
187
- errors: undefined,
188
- value: undefined,
189
- });
190
-
191
- watch(
192
- () => snapshot.outputs,
193
- () => {
194
- try {
195
- Object.assign(data, {
196
- value: this.unwrapOutputs<K>(...keys),
197
- errors: undefined,
198
- });
199
- } catch (error) {
200
- Object.assign(data, {
201
- value: undefined,
202
- errors: [String(error)],
203
- });
204
- }
205
- },
206
- { immediate: true, deep: true },
207
- );
208
-
209
- return data as OptionalResult<UnwrapOutputs<Outputs, K>>;
210
- },
211
- /**
212
- * Retrieves the unwrapped values of outputs for the given keys.
213
- *
214
- * @template K - Keys of the outputs to unwrap.
215
- * @param keys - List of output names.
216
- * @throws Error if the outputs contain errors.
217
- * @returns An object with unwrapped output values.
218
- */
219
- unwrapOutputs<K extends keyof Outputs>(...keys: K[]): UnwrapOutputs<Outputs, K> {
220
- const outputs = snapshot.outputs;
221
- const entries = keys.map((key) => [key, unwrapOutput(outputs[key])]);
222
- return Object.fromEntries(entries);
223
- },
224
- /**
225
- * Updates the arguments state by applying a callback.
226
- *
227
- * @param cb - Callback to modify the current arguments.
228
- * @returns A promise resolving after the update is applied.
229
- */
230
- updateArgs(cb: (args: Args) => void) {
231
- const newArgs = cloneArgs();
232
- cb(newArgs);
233
- return platforma.setBlockArgs(newArgs);
234
- },
235
- /**
236
- * Updates the UI state by applying a callback.
237
- *
238
- * @param cb - Callback to modify the current UI state.
239
- * @returns A promise resolving after the update is applied.
240
- * @todo Make it mutable since there is already an initial one
241
- */
242
- updateUiState(cb: (args: UiState) => UiState): Promise<void> {
243
- const newUiState = cloneUiState();
244
- return platforma.setBlockUiState(cb(newUiState));
245
- },
246
- /**
247
- * Updates the navigation state by applying a callback.
248
- *
249
- * @param cb - Callback to modify the current navigation state.
250
- * @returns A promise resolving after the update is applied.
251
- */
252
- updateNavigationState(cb: (args: Mutable<NavigationState<Href>>) => void) {
253
- const newState = cloneNavigationState();
254
- cb(newState);
255
- return platforma.setNavigationState(newState);
256
- },
257
- /**
258
- * Navigates to a specific href by updating the navigation state.
259
- *
260
- * @param href - The target href to navigate to.
261
- * @returns A promise resolving after the navigation state is updated.
262
- */
263
- navigateTo(href: Href) {
264
- const newState = cloneNavigationState();
265
- newState.href = href;
266
- return platforma.setNavigationState(newState);
267
- },
268
- };
269
-
270
- const outputs = computed<OutputValues<Outputs>>(() => {
271
- const entries = Object.entries(snapshot.outputs).map(([k, outputWithStatus]) =>
272
- platforma.blockModelInfo.outputs[k].withStatus
273
- ? [k, ensureOutputHasStableFlag(outputWithStatus)]
274
- : [
275
- k,
276
- outputWithStatus.ok && outputWithStatus.value !== undefined
277
- ? outputWithStatus.value
278
- : undefined,
279
- ],
280
- );
281
- return Object.fromEntries(entries);
282
- });
283
-
284
- const outputErrors = computed<OutputErrors<Outputs>>(() => {
285
- const entries = Object.entries(snapshot.outputs).map(([k, vOrErr]) => [
286
- k,
287
- vOrErr && vOrErr.ok === false ? new MultiError(vOrErr.errors) : undefined,
288
- ]);
289
- return Object.fromEntries(entries);
290
- });
291
-
292
- const getters = {
293
- snapshot,
294
- queryParams: computed(() => parseQuery<Href>(snapshot.navigationState.href)),
295
- href: computed(() => snapshot.navigationState.href),
296
- hasErrors: computed(() => Object.values(snapshot.outputs).some((v) => !v?.ok)),
297
- };
298
-
299
- const model = createAppModel(
300
- {
301
- get() {
302
- return { args: snapshot.args, ui: snapshot.ui } as AppModel;
303
- },
304
- autoSave: true,
305
- onSave(newData: AppModel) {
306
- setBlockArgsAndUiState(newData.args, newData.ui);
307
- },
308
- },
309
- {
310
- outputs,
311
- outputErrors,
312
- },
313
- settings,
314
- );
315
-
316
- return reactive(Object.assign(model, methods, getters));
317
- }
318
-
319
- export type BaseAppV1<
320
- Args = unknown,
321
- Outputs extends BlockOutputsBase = BlockOutputsBase,
322
- UiState = unknown,
323
- Href extends `/${string}` = `/${string}`,
324
- > = ReturnType<typeof createAppV1<Args, Outputs, UiState, Href>>;