akanjs 2.2.4-rc.4 → 2.2.4
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/base/base.test.ts +135 -0
- package/base/base.ts +1 -1
- package/base/baseEnv.test.ts +146 -0
- package/base/primitiveRegistry.test.ts +127 -0
- package/base/primitiveRegistry.ts +10 -6
- package/base/symbols.test.ts +29 -0
- package/base/types.ts +4 -1
- package/base/utils.test.ts +30 -0
- package/build.ts +318 -0
- package/capacitor.base.config.test.ts +83 -0
- package/capacitor.base.config.ts +1 -1
- package/client/capacitor.ts +1 -1
- package/client/client.auth-storage.test.ts +210 -0
- package/client/client.decorators.test.ts +74 -0
- package/client/client.device.test.ts +181 -0
- package/client/client.page.test.tsx +175 -0
- package/client/client.pure.test.ts +146 -0
- package/client/client.router.test.ts +290 -0
- package/client/cookie.ts +4 -2
- package/client/createFont.ts +2 -2
- package/client/csrTypes.ts +8 -2
- package/client/makePageProto.tsx +10 -4
- package/client/router.ts +8 -3
- package/client/translator.ts +12 -4
- package/common/Logger.test.ts +45 -0
- package/common/Logger.ts +4 -1
- package/common/formatAndValidation.test.ts +61 -0
- package/common/formatNumber.ts +5 -2
- package/common/hmrPhase.ts +1 -1
- package/common/httpClient.test.ts +91 -0
- package/common/isValidDate.ts +3 -0
- package/common/objectPath.test.ts +108 -0
- package/common/routeConvention.test.ts +132 -0
- package/common/runtimeConfig.test.ts +84 -0
- package/constant/constant.test.ts +374 -0
- package/constant/fieldInfo.ts +3 -3
- package/constant/purify.ts +2 -1
- package/constant/types.ts +4 -0
- package/constant/via.ts +12 -6
- package/dictionary/dictionary.test.ts +352 -0
- package/document/databaseRegistry.ts +8 -0
- package/document/document.test.ts +698 -0
- package/document/into.ts +1 -0
- package/fetch/client/fetchClient.ts +6 -1
- package/fetch/client/httpClient.ts +2 -1
- package/fetch/fetch.test.ts +838 -0
- package/fetch/fetchType/appliedReturn.type.ts +1 -0
- package/fetch/fetchType/endpointFetch.type.ts +3 -0
- package/fetch/fetchType/sliceFetch.type.ts +8 -0
- package/fetch/requestStorage.ts +10 -2
- package/package.json +24 -67
- package/server/akanApp.test.ts +130 -0
- package/server/akanApp.ts +5 -2
- package/server/akanLib.ts +1 -0
- package/server/akanServer.test.ts +157 -0
- package/server/akanServer.ts +4 -3
- package/server/artifact/builderRpc.ts +2 -2
- package/server/artifact/ipcTypes.ts +4 -0
- package/server/artifact/routeClientCache.test.ts +265 -0
- package/server/artifact/routeSeedIndex.test.ts +56 -0
- package/server/artifact/routesManifest.test.ts +64 -0
- package/server/decorators.ts +1 -1
- package/server/di/diLifecycle.contract.test.ts +168 -0
- package/server/di/diLifecycle.ts +6 -3
- package/server/hmr/clientScript.ts +20 -2
- package/server/hmr/devHmrController.ts +4 -0
- package/server/logging/rotatingLogWriter.test.ts +119 -0
- package/server/processMetrics.test.ts +24 -0
- package/server/processMetricsCollector.ts +1 -1
- package/server/proxy/webProxyRunner.test.ts +66 -0
- package/server/resolver/database.resolver.ts +2 -2
- package/server/resolver/resolver.contract.fixture.ts +1 -0
- package/server/resolver/resolver.contract.test.ts +594 -0
- package/server/resolver/signal.resolver.ts +10 -2
- package/server/robots.test.ts +16 -0
- package/server/routeTree.test.tsx +198 -0
- package/server/routing/apiRouter.test.ts +136 -0
- package/server/routing/apiRouter.ts +4 -2
- package/server/rscClient.tsx +7 -1
- package/server/rscWorkerHost.ts +33 -11
- package/server/sitemap.test.ts +61 -0
- package/server/ssrFromRscRenderer.tsx +35 -3
- package/server/systemPages.test.tsx +93 -0
- package/server/types/react-server-dom-webpack.d.ts +7 -1
- package/server/vendor/react-dom-client.ts +1 -1
- package/server/vendor/react-dom.ts +3 -2
- package/server/vendor/react-jsx-dev-runtime.ts +1 -1
- package/server/vendor/react-jsx-runtime.ts +1 -1
- package/server/vendor/react-refresh-runtime.ts +2 -2
- package/server/vendor/react-server-dom-webpack-client-browser.ts +1 -1
- package/server/vendor/react.ts +9 -2
- package/server/vendor/scheduler.ts +3 -2
- package/server/webRouter.test.ts +49 -0
- package/server/webRouter.ts +3 -2
- package/service/adapt.ts +5 -1
- package/service/predefinedAdaptor/cache.adaptor.ts +2 -1
- package/service/predefinedAdaptor/compress.adaptor.test.ts +184 -0
- package/service/predefinedAdaptor/database.adaptor.ts +20 -8
- package/service/predefinedAdaptor/solidCache.adaptor.test.ts +107 -0
- package/service/predefinedAdaptor/solidSqlite.test.ts +457 -0
- package/service/predefinedAdaptor/solidSqlite.ts +2 -1
- package/service/predefinedAdaptor/websocket.adaptor.ts +15 -3
- package/service/serve.ts +7 -3
- package/service/service.test.ts +732 -0
- package/signal/base.signal.ts +1 -0
- package/signal/endpointInfo.ts +7 -0
- package/signal/intercept.ts +2 -0
- package/signal/middleware.ts +2 -1
- package/signal/serverSignal.ts +15 -1
- package/signal/signal.test.ts +892 -0
- package/signal/signalContext.ts +1 -1
- package/signal/signalRegistry.ts +5 -0
- package/signal/sliceInfo.ts +3 -0
- package/signal/trace.ts +11 -0
- package/signal/types.ts +11 -2
- package/store/action.ts +5 -3
- package/store/stateBuilder.test.ts +168 -0
- package/store/stateBuilder.ts +2 -0
- package/store/stateInfo.ts +2 -1
- package/store/store.test.ts +427 -0
- package/store/types.ts +1 -1
- package/test/playwright.config.base.ts +28 -5
- package/test/playwright.pageAgent.ts +1 -1
- package/test/sampleOf.ts +1 -1
- package/test/testServer.ts +1 -1
- package/tsconfig.json +5 -0
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Clipboard.tsx +1 -1
- package/ui/Constant/schemaDoc.test.ts +113 -0
- package/ui/CsrImage.tsx +14 -3
- package/ui/Data/ListContainer.tsx +1 -1
- package/ui/Data/Pagination.tsx +1 -1
- package/ui/Data/QueryMaker.tsx +339 -0
- package/ui/Data/index.ts +1 -0
- package/ui/DatePicker.tsx +95 -1
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/DraggableList.tsx +5 -5
- package/ui/Field.tsx +3 -2
- package/ui/Image.tsx +3 -2
- package/ui/InfiniteScroll.test.tsx +155 -0
- package/ui/InfiniteScroll.tsx +1 -0
- package/ui/Input.tsx +8 -1
- package/ui/Layout/BottomTab.tsx +2 -2
- package/ui/Link/SsrLink.tsx +2 -1
- package/ui/Load/Page.tsx +1 -1
- package/ui/Load/PageCSR.tsx +1 -0
- package/ui/Load/Units.tsx +2 -1
- package/ui/Load/View.tsx +2 -1
- package/ui/Menu.tsx +8 -5
- package/ui/Model/EditModal.tsx +5 -2
- package/ui/Popconfirm.tsx +4 -2
- package/ui/ScreenNavigator.tsx +3 -2
- package/ui/Signal/Message.tsx +3 -2
- package/ui/Signal/PubSub.tsx +2 -0
- package/ui/Signal/Response.tsx +1 -1
- package/ui/Signal/WebSocket.tsx +11 -2
- package/ui/System/Client.tsx +41 -7
- package/ui/System/Common.test.ts +37 -0
- package/ui/System/Gtag.tsx +5 -2
- package/ui/System/Messages.tsx +2 -2
- package/ui/System/Reconnect.tsx +6 -5
- package/ui/System/Root.tsx +1 -0
- package/ui/System/SSR.tsx +7 -1
- package/ui/ToggleSelect.tsx +8 -3
- package/ui/Unauthorized.tsx +1 -1
- package/webkit/bootCsr.test.tsx +153 -0
- package/webkit/bootCsr.tsx +6 -3
- package/webkit/lazy.tsx +8 -1
- package/webkit/native.test.tsx +341 -0
- package/webkit/useCamera.tsx +1 -0
- package/webkit/useCodepush.tsx +9 -4
- package/webkit/useContact.tsx +1 -0
- package/webkit/useCsrValues.ts +10 -6
- package/webkit/useDebounce.ts +2 -2
- package/webkit/usePurchase.tsx +9 -5
- package/webkit/usePushNoti.tsx +1 -0
- package/webkit/webkit.test.tsx +531 -0
- package/types/base/base.d.ts +0 -53
- package/types/base/baseEnv.d.ts +0 -68
- package/types/base/index.d.ts +0 -6
- package/types/base/primitiveRegistry.d.ts +0 -134
- package/types/base/symbols.d.ts +0 -11
- package/types/base/types.d.ts +0 -68
- package/types/base/utils.d.ts +0 -4
- package/types/base.d.ts +0 -1
- package/types/capacitor.base.config.d.ts +0 -3
- package/types/client/capacitor.d.ts +0 -233
- package/types/client/clientRuntime.d.ts +0 -63
- package/types/client/cookie.d.ts +0 -33
- package/types/client/createFont.d.ts +0 -6
- package/types/client/csrTypes.d.ts +0 -262
- package/types/client/decorators.d.ts +0 -7
- package/types/client/device.d.ts +0 -41
- package/types/client/fetch.d.ts +0 -1
- package/types/client/index.d.ts +0 -14
- package/types/client/locale.d.ts +0 -5
- package/types/client/makePageProto.d.ts +0 -17002
- package/types/client/router.d.ts +0 -66
- package/types/client/rscNavigation.d.ts +0 -19
- package/types/client/storage.d.ts +0 -5
- package/types/client/translator.d.ts +0 -18
- package/types/client/types.d.ts +0 -145
- package/types/client/useClient.d.ts +0 -1
- package/types/client.d.ts +0 -1
- package/types/common/Logger.d.ts +0 -41
- package/types/common/applyMixins.d.ts +0 -3
- package/types/common/capitalize.d.ts +0 -2
- package/types/common/deepObjectify.d.ts +0 -4
- package/types/common/fileUpload.d.ts +0 -28
- package/types/common/formatNumber.d.ts +0 -1
- package/types/common/formatPhone.d.ts +0 -2
- package/types/common/getAllPropertyDescriptors.d.ts +0 -5
- package/types/common/hmrPhase.d.ts +0 -6
- package/types/common/httpClient.d.ts +0 -20
- package/types/common/index.d.ts +0 -29
- package/types/common/isDayjs.d.ts +0 -2
- package/types/common/isEmail.d.ts +0 -2
- package/types/common/isPhoneNumber.d.ts +0 -2
- package/types/common/isQueryEqual.d.ts +0 -1
- package/types/common/isValidDate.d.ts +0 -2
- package/types/common/jwtDecode.d.ts +0 -2
- package/types/common/localeConfig.d.ts +0 -11
- package/types/common/lowerlize.d.ts +0 -2
- package/types/common/mergeVersion.d.ts +0 -10
- package/types/common/objectify.d.ts +0 -1
- package/types/common/pathGet.d.ts +0 -1
- package/types/common/pathSet.d.ts +0 -3
- package/types/common/randomPick.d.ts +0 -1
- package/types/common/randomPicks.d.ts +0 -1
- package/types/common/routeConvention.d.ts +0 -35
- package/types/common/sleep.d.ts +0 -2
- package/types/common/splitVersion.d.ts +0 -11
- package/types/common/subRoute.d.ts +0 -7
- package/types/common/types.d.ts +0 -14
- package/types/common.d.ts +0 -1
- package/types/constant/constantRegistry.d.ts +0 -89
- package/types/constant/crystalize.d.ts +0 -4
- package/types/constant/deserialize.d.ts +0 -7
- package/types/constant/fieldInfo.d.ts +0 -153
- package/types/constant/getDefault.d.ts +0 -3
- package/types/constant/immerify.d.ts +0 -2
- package/types/constant/index.d.ts +0 -10
- package/types/constant/purify.d.ts +0 -12
- package/types/constant/serialize.d.ts +0 -11
- package/types/constant/types.d.ts +0 -77
- package/types/constant/via.d.ts +0 -52
- package/types/constant.d.ts +0 -1
- package/types/dictionary/base.dictionary.d.ts +0 -1
- package/types/dictionary/dictInfo.d.ts +0 -206
- package/types/dictionary/dictionary.d.ts +0 -11
- package/types/dictionary/index.d.ts +0 -4
- package/types/dictionary/locale.d.ts +0 -128
- package/types/dictionary/trans.d.ts +0 -82
- package/types/dictionary.d.ts +0 -1
- package/types/document/by.d.ts +0 -20
- package/types/document/dataLoader.d.ts +0 -36
- package/types/document/database.d.ts +0 -96
- package/types/document/databaseRegistry.d.ts +0 -36
- package/types/document/documentQuery.d.ts +0 -105
- package/types/document/documentSchema.d.ts +0 -33
- package/types/document/filterMeta.d.ts +0 -84
- package/types/document/index.d.ts +0 -11
- package/types/document/into.d.ts +0 -65
- package/types/document/loaderInfo.d.ts +0 -35
- package/types/document/schema.d.ts +0 -5
- package/types/document/types.d.ts +0 -36
- package/types/document.d.ts +0 -1
- package/types/fetch/client/fetchClient.d.ts +0 -78
- package/types/fetch/client/httpClient.d.ts +0 -39
- package/types/fetch/client/index.d.ts +0 -3
- package/types/fetch/client/wsClient.d.ts +0 -37
- package/types/fetch/client.d.ts +0 -1
- package/types/fetch/fetchType/appliedReturn.type.d.ts +0 -67
- package/types/fetch/fetchType/buildFetch.type.d.ts +0 -11
- package/types/fetch/fetchType/clientSignal.type.d.ts +0 -16
- package/types/fetch/fetchType/endpointFetch.type.d.ts +0 -29
- package/types/fetch/fetchType/index.d.ts +0 -5
- package/types/fetch/fetchType/sliceFetch.type.d.ts +0 -76
- package/types/fetch/fetchType.d.ts +0 -1
- package/types/fetch/index.d.ts +0 -4
- package/types/fetch/requestStorage.d.ts +0 -29
- package/types/fetch/serializer/fetch.serializer.d.ts +0 -14
- package/types/fetch/serializer/index.d.ts +0 -1
- package/types/fetch/serializer.d.ts +0 -1
- package/types/fetch/types.d.ts +0 -19
- package/types/fetch.d.ts +0 -1
- package/types/index.d.ts +0 -213
- package/types/server/akanApp.d.ts +0 -17
- package/types/server/akanAppHeaders.d.ts +0 -1
- package/types/server/akanLib.d.ts +0 -33
- package/types/server/akanOption.d.ts +0 -15
- package/types/server/akanServer.d.ts +0 -47
- package/types/server/artifact/builderRpc.d.ts +0 -42
- package/types/server/artifact/index.d.ts +0 -6
- package/types/server/artifact/ipcTypes.d.ts +0 -73
- package/types/server/artifact/manifestTypes.d.ts +0 -16
- package/types/server/artifact/routeClientCache.d.ts +0 -45
- package/types/server/artifact/routeSeedIndexStore.d.ts +0 -43
- package/types/server/artifact/routesManifestStore.d.ts +0 -16
- package/types/server/artifact.d.ts +0 -1
- package/types/server/decorators.d.ts +0 -6
- package/types/server/di/diLifecycle.d.ts +0 -45
- package/types/server/di/index.d.ts +0 -4
- package/types/server/di/predefinedAdaptor.d.ts +0 -33
- package/types/server/di/resolveAdaptorHierarchy.d.ts +0 -21
- package/types/server/di/resolveHierarchy.d.ts +0 -11
- package/types/server/di/resolveServiceHierarchy.d.ts +0 -13
- package/types/server/di/utils.d.ts +0 -14
- package/types/server/di.d.ts +0 -1
- package/types/server/hmr/changeBatch.d.ts +0 -13
- package/types/server/hmr/clientScript.d.ts +0 -1
- package/types/server/hmr/devHmrController.d.ts +0 -24
- package/types/server/hmr/index.d.ts +0 -4
- package/types/server/hmr/wsHub.d.ts +0 -45
- package/types/server/hmr.d.ts +0 -1
- package/types/server/imageOptimizer.d.ts +0 -12
- package/types/server/imageOptimizerError.d.ts +0 -4
- package/types/server/index.d.ts +0 -14
- package/types/server/lifecycle/shutdownManager.d.ts +0 -13
- package/types/server/logging/rotatingLogWriter.d.ts +0 -20
- package/types/server/processMetricsCollector.d.ts +0 -10
- package/types/server/proxy/akanResponse.d.ts +0 -7
- package/types/server/proxy/bunRequestFields.d.ts +0 -1
- package/types/server/proxy/hostBasePathWebProxy.d.ts +0 -6
- package/types/server/proxy/index.d.ts +0 -6
- package/types/server/proxy/localeWebProxy.d.ts +0 -5
- package/types/server/proxy/types.d.ts +0 -37
- package/types/server/proxy/webProxyRunner.d.ts +0 -7
- package/types/server/proxy.d.ts +0 -1
- package/types/server/resolver/database.resolver.d.ts +0 -6
- package/types/server/resolver/index.d.ts +0 -3
- package/types/server/resolver/service.resolver.d.ts +0 -7
- package/types/server/resolver/signal.resolver.d.ts +0 -29
- package/types/server/resolver.d.ts +0 -1
- package/types/server/robots.d.ts +0 -1
- package/types/server/routeElementComposer.d.ts +0 -41
- package/types/server/routeTreeBuilder.d.ts +0 -28
- package/types/server/routing/apiRouter.d.ts +0 -61
- package/types/server/rscClient.d.ts +0 -15
- package/types/server/rscWorker.d.ts +0 -3
- package/types/server/rscWorkerHost.d.ts +0 -83
- package/types/server/sitemap.d.ts +0 -13
- package/types/server/ssrFromRscRenderer.d.ts +0 -6
- package/types/server/ssrTypes.d.ts +0 -47
- package/types/server/systemPages.d.ts +0 -27
- package/types/server/types/react-server-dom-webpack.d.ts +0 -91
- package/types/server/types.d.ts +0 -67
- package/types/server/vendor/akanjs-base.d.ts +0 -1
- package/types/server/vendor/akanjs-common.d.ts +0 -1
- package/types/server/vendor/akanjs-constant.d.ts +0 -1
- package/types/server/vendor/akanjs-store.d.ts +0 -1
- package/types/server/vendor/react-dom-client.d.ts +0 -3
- package/types/server/vendor/react-dom.d.ts +0 -3
- package/types/server/vendor/react-jsx-dev-runtime.d.ts +0 -3
- package/types/server/vendor/react-jsx-runtime.d.ts +0 -3
- package/types/server/vendor/react-refresh-runtime.d.ts +0 -3
- package/types/server/vendor/react-server-dom-webpack-client-browser.d.ts +0 -3
- package/types/server/vendor/react.d.ts +0 -11
- package/types/server/vendor/scheduler.d.ts +0 -3
- package/types/server/webRouter.d.ts +0 -44
- package/types/server.d.ts +0 -1
- package/types/service/adapt.d.ts +0 -15
- package/types/service/base.service.d.ts +0 -18
- package/types/service/index.d.ts +0 -10
- package/types/service/injectInfo.d.ts +0 -102
- package/types/service/ipcTypes.d.ts +0 -194
- package/types/service/predefinedAdaptor/cache.adaptor.d.ts +0 -46
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +0 -22
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +0 -329
- package/types/service/predefinedAdaptor/index.d.ts +0 -13
- package/types/service/predefinedAdaptor/logging.adaptor.d.ts +0 -20
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +0 -22
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +0 -17
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +0 -60
- package/types/service/predefinedAdaptor/solidCache.adaptor.d.ts +0 -25
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +0 -20
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +0 -19
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +0 -24
- package/types/service/predefinedAdaptor/sqlitePath.d.ts +0 -9
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +0 -80
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +0 -49
- package/types/service/predefinedAdaptor.d.ts +0 -1
- package/types/service/serve.d.ts +0 -31
- package/types/service/serviceModule.d.ts +0 -50
- package/types/service/serviceRegistry.d.ts +0 -9
- package/types/service/types.d.ts +0 -55
- package/types/service.d.ts +0 -1
- package/types/signal/base.signal.d.ts +0 -41
- package/types/signal/endpoint.d.ts +0 -28
- package/types/signal/endpointInfo.d.ts +0 -77
- package/types/signal/exception.d.ts +0 -54786
- package/types/signal/guard.d.ts +0 -10
- package/types/signal/guards.d.ts +0 -10
- package/types/signal/index.d.ts +0 -19
- package/types/signal/intercept.d.ts +0 -17
- package/types/signal/internal.d.ts +0 -18
- package/types/signal/internalArg.d.ts +0 -31
- package/types/signal/internalInfo.d.ts +0 -45
- package/types/signal/middleware.d.ts +0 -51
- package/types/signal/serializer/fetch.serializer.d.ts +0 -14
- package/types/signal/serializer/index.d.ts +0 -1
- package/types/signal/serializer.d.ts +0 -1
- package/types/signal/serverSignal.d.ts +0 -36
- package/types/signal/signalContext.d.ts +0 -96
- package/types/signal/signalRegistry.d.ts +0 -49
- package/types/signal/slice.d.ts +0 -42
- package/types/signal/sliceInfo.d.ts +0 -51
- package/types/signal/trace.d.ts +0 -97
- package/types/signal/types.d.ts +0 -142
- package/types/signal.d.ts +0 -1
- package/types/store/action.d.ts +0 -145
- package/types/store/baseSt.d.ts +0 -412
- package/types/store/hooks.d.ts +0 -1
- package/types/store/index.d.ts +0 -8
- package/types/store/rootStore.d.ts +0 -22
- package/types/store/state.d.ts +0 -91
- package/types/store/stateBuilder.d.ts +0 -141
- package/types/store/stateInfo.d.ts +0 -23
- package/types/store/store.d.ts +0 -36
- package/types/store/storeInstance.d.ts +0 -38
- package/types/store/storeRegistry.d.ts +0 -13
- package/types/store/types.d.ts +0 -42
- package/types/store/withSelector.d.ts +0 -42
- package/types/store.d.ts +0 -1
- package/types/test/index.d.ts +0 -4
- package/types/test/playwright.config.base.d.ts +0 -9
- package/types/test/playwright.pageAgent.d.ts +0 -12
- package/types/test/sample.d.ts +0 -15
- package/types/test/sampleOf.d.ts +0 -5
- package/types/test/signalTest.preload.d.ts +0 -1
- package/types/test/signalTestRuntime.d.ts +0 -29
- package/types/test/testServer.d.ts +0 -26
- package/types/test.d.ts +0 -1
- package/types/ui/BottomSheet.d.ts +0 -13
- package/types/ui/Button.d.ts +0 -11
- package/types/ui/ClientSide.d.ts +0 -8
- package/types/ui/Clipboard.d.ts +0 -7
- package/types/ui/Constant/Doc.d.ts +0 -29
- package/types/ui/Constant/Mermaid.d.ts +0 -8
- package/types/ui/Constant/index.d.ts +0 -6
- package/types/ui/Constant/schemaDoc.d.ts +0 -84
- package/types/ui/Constant.d.ts +0 -1
- package/types/ui/Copy.d.ts +0 -10
- package/types/ui/CsrImage.d.ts +0 -18
- package/types/ui/Data/CardList.d.ts +0 -36
- package/types/ui/Data/Dashboard.d.ts +0 -11
- package/types/ui/Data/Insight.d.ts +0 -9
- package/types/ui/Data/Item.d.ts +0 -75
- package/types/ui/Data/ListContainer.d.ts +0 -49
- package/types/ui/Data/Pagination.d.ts +0 -9
- package/types/ui/Data/QueryMaker.d.ts +0 -8
- package/types/ui/Data/TableList.d.ts +0 -26
- package/types/ui/Data/index.d.ts +0 -9
- package/types/ui/Data/index_.d.ts +0 -8
- package/types/ui/Data.d.ts +0 -1
- package/types/ui/DatePicker.d.ts +0 -36
- package/types/ui/Dialog/Action.d.ts +0 -5
- package/types/ui/Dialog/Close.d.ts +0 -6
- package/types/ui/Dialog/Content.d.ts +0 -6
- package/types/ui/Dialog/Modal.d.ts +0 -9
- package/types/ui/Dialog/Provider.d.ts +0 -11
- package/types/ui/Dialog/Title.d.ts +0 -5
- package/types/ui/Dialog/Trigger.d.ts +0 -6
- package/types/ui/Dialog/context.d.ts +0 -10
- package/types/ui/Dialog/index.d.ts +0 -9
- package/types/ui/Dialog.d.ts +0 -1
- package/types/ui/DragAction.d.ts +0 -24
- package/types/ui/DraggableList.d.ts +0 -31
- package/types/ui/Dropdown.d.ts +0 -14
- package/types/ui/Empty.d.ts +0 -12
- package/types/ui/Field.d.ts +0 -411
- package/types/ui/FontFace.d.ts +0 -6
- package/types/ui/Image.d.ts +0 -49
- package/types/ui/InfiniteScroll.d.ts +0 -10
- package/types/ui/Input.d.ts +0 -95
- package/types/ui/KeyboardAvoiding.d.ts +0 -8
- package/types/ui/Layout/BottomAction.d.ts +0 -6
- package/types/ui/Layout/BottomInset.d.ts +0 -7
- package/types/ui/Layout/BottomTab.d.ts +0 -14
- package/types/ui/Layout/Header.d.ts +0 -8
- package/types/ui/Layout/LeftSider.d.ts +0 -9
- package/types/ui/Layout/Navbar.d.ts +0 -11
- package/types/ui/Layout/RightSider.d.ts +0 -10
- package/types/ui/Layout/Sider.d.ts +0 -7
- package/types/ui/Layout/Template.d.ts +0 -7
- package/types/ui/Layout/TopLeftAction.d.ts +0 -6
- package/types/ui/Layout/Unit.d.ts +0 -9
- package/types/ui/Layout/View.d.ts +0 -8
- package/types/ui/Layout/Zone.d.ts +0 -6
- package/types/ui/Layout/index.d.ts +0 -14
- package/types/ui/Layout.d.ts +0 -1
- package/types/ui/Link/Back.d.ts +0 -7
- package/types/ui/Link/Close.d.ts +0 -7
- package/types/ui/Link/CsrLink.d.ts +0 -2
- package/types/ui/Link/Lang.d.ts +0 -8
- package/types/ui/Link/SsrLink.d.ts +0 -2
- package/types/ui/Link/index.d.ts +0 -10
- package/types/ui/Link/types.d.ts +0 -42
- package/types/ui/Link.d.ts +0 -1
- package/types/ui/Load/Edit.d.ts +0 -4
- package/types/ui/Load/Edit_Client.d.ts +0 -27
- package/types/ui/Load/Page.d.ts +0 -15
- package/types/ui/Load/PageCSR.d.ts +0 -3
- package/types/ui/Load/Pagination.d.ts +0 -8
- package/types/ui/Load/Units.d.ts +0 -30
- package/types/ui/Load/View.d.ts +0 -22
- package/types/ui/Load/index.d.ts +0 -8
- package/types/ui/Load/index_.d.ts +0 -3
- package/types/ui/Load.d.ts +0 -1
- package/types/ui/Loading/Area.d.ts +0 -1
- package/types/ui/Loading/Button.d.ts +0 -7
- package/types/ui/Loading/Input.d.ts +0 -7
- package/types/ui/Loading/ProgressBar.d.ts +0 -6
- package/types/ui/Loading/Skeleton.d.ts +0 -7
- package/types/ui/Loading/Spin.d.ts +0 -7
- package/types/ui/Loading/index.d.ts +0 -8
- package/types/ui/Loading.d.ts +0 -1
- package/types/ui/Menu.d.ts +0 -26
- package/types/ui/Modal.d.ts +0 -19
- package/types/ui/Model/AdminPanel.d.ts +0 -31
- package/types/ui/Model/Edit.d.ts +0 -16
- package/types/ui/Model/EditModal.d.ts +0 -52
- package/types/ui/Model/EditWrapper.d.ts +0 -13
- package/types/ui/Model/LoadInit.d.ts +0 -10
- package/types/ui/Model/New.d.ts +0 -16
- package/types/ui/Model/NewWrapper.d.ts +0 -13
- package/types/ui/Model/NewWrapper_Client.d.ts +0 -13
- package/types/ui/Model/Remove.d.ts +0 -13
- package/types/ui/Model/RemoveWrapper.d.ts +0 -12
- package/types/ui/Model/SureToRemove.d.ts +0 -11
- package/types/ui/Model/View.d.ts +0 -19
- package/types/ui/Model/ViewEditModal.d.ts +0 -12
- package/types/ui/Model/ViewModal.d.ts +0 -14
- package/types/ui/Model/ViewWrapper.d.ts +0 -12
- package/types/ui/Model/index.d.ts +0 -16
- package/types/ui/Model/index_.d.ts +0 -14
- package/types/ui/Model.d.ts +0 -1
- package/types/ui/More.d.ts +0 -12
- package/types/ui/ObjectId.d.ts +0 -5
- package/types/ui/Pagination.d.ts +0 -20
- package/types/ui/Popconfirm.d.ts +0 -28
- package/types/ui/Portal.d.ts +0 -6
- package/types/ui/Radio.d.ts +0 -19
- package/types/ui/RecentTime.d.ts +0 -12
- package/types/ui/Refresh.d.ts +0 -7
- package/types/ui/ScreenNavigator.d.ts +0 -18
- package/types/ui/Select.d.ts +0 -43
- package/types/ui/Signal/Arg.d.ts +0 -78
- package/types/ui/Signal/Doc.d.ts +0 -33
- package/types/ui/Signal/Listener.d.ts +0 -9
- package/types/ui/Signal/Message.d.ts +0 -23
- package/types/ui/Signal/Object.d.ts +0 -20
- package/types/ui/Signal/PubSub.d.ts +0 -24
- package/types/ui/Signal/Request.d.ts +0 -8
- package/types/ui/Signal/Response.d.ts +0 -14
- package/types/ui/Signal/RestApi.d.ts +0 -40
- package/types/ui/Signal/WebSocket.d.ts +0 -11
- package/types/ui/Signal/index.d.ts +0 -18
- package/types/ui/Signal/makeExample.d.ts +0 -4
- package/types/ui/Signal/style.d.ts +0 -15
- package/types/ui/Signal.d.ts +0 -1
- package/types/ui/System/CSR.d.ts +0 -32
- package/types/ui/System/Client.d.ts +0 -47
- package/types/ui/System/Common.d.ts +0 -47
- package/types/ui/System/DevModeToggle.d.ts +0 -1
- package/types/ui/System/Gtag.d.ts +0 -4
- package/types/ui/System/Messages.d.ts +0 -1
- package/types/ui/System/Reconnect.d.ts +0 -1
- package/types/ui/System/Root.d.ts +0 -6
- package/types/ui/System/SSR.d.ts +0 -24
- package/types/ui/System/SelectLanguage.d.ts +0 -5
- package/types/ui/System/ThemeToggle.d.ts +0 -4
- package/types/ui/System/index.d.ts +0 -12
- package/types/ui/System.d.ts +0 -1
- package/types/ui/Tab/Menu.d.ts +0 -12
- package/types/ui/Tab/Menus.d.ts +0 -6
- package/types/ui/Tab/Panel.d.ts +0 -8
- package/types/ui/Tab/Provider.d.ts +0 -10
- package/types/ui/Tab/context.d.ts +0 -9
- package/types/ui/Tab/index.d.ts +0 -7
- package/types/ui/Tab.d.ts +0 -1
- package/types/ui/Table.d.ts +0 -41
- package/types/ui/ToggleSelect.d.ts +0 -33
- package/types/ui/Unauthorized.d.ts +0 -9
- package/types/ui/animated.d.ts +0 -5
- package/types/ui/fontCss.d.ts +0 -11
- package/types/ui/index.d.ts +0 -44
- package/types/ui.d.ts +0 -1
- package/types/webkit/bootCsr.d.ts +0 -16
- package/types/webkit/createRobotPage.d.ts +0 -15
- package/types/webkit/createSitemapPage.d.ts +0 -4
- package/types/webkit/index.d.ts +0 -17
- package/types/webkit/lazy.d.ts +0 -11
- package/types/webkit/types.d.ts +0 -7
- package/types/webkit/useCamera.d.ts +0 -19
- package/types/webkit/useCodepush.d.ts +0 -16
- package/types/webkit/useContact.d.ts +0 -11
- package/types/webkit/useCsrValues.d.ts +0 -30
- package/types/webkit/useDebounce.d.ts +0 -2
- package/types/webkit/useFetch.d.ts +0 -18
- package/types/webkit/useGeoLocation.d.ts +0 -8
- package/types/webkit/useHistory.d.ts +0 -23
- package/types/webkit/useInterval.d.ts +0 -2
- package/types/webkit/useLocation.d.ts +0 -8
- package/types/webkit/usePurchase.d.ts +0 -19
- package/types/webkit/usePushNoti.d.ts +0 -7
- package/types/webkit/useThrottle.d.ts +0 -2
- package/types/webkit.d.ts +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { afterEach, beforeAll, describe, expect, mock, test } from "bun:test";
|
|
2
|
+
import type { InfiniteScrollProps } from "./InfiniteScroll";
|
|
3
|
+
|
|
4
|
+
type Effect = () => (() => void) | undefined;
|
|
5
|
+
|
|
6
|
+
const effectQueue: Effect[] = [];
|
|
7
|
+
const effectCleanups: Array<() => void> = [];
|
|
8
|
+
let hookIndex = 0;
|
|
9
|
+
const hookStates: unknown[] = [];
|
|
10
|
+
let latestObserver: FakeIntersectionObserver | undefined;
|
|
11
|
+
const originalIntersectionObserver = globalThis.IntersectionObserver;
|
|
12
|
+
|
|
13
|
+
const fakeElement = { nodeType: 1, nodeName: "DIV" } as Element;
|
|
14
|
+
|
|
15
|
+
const resetHooks = () => {
|
|
16
|
+
hookIndex = 0;
|
|
17
|
+
hookStates.length = 0;
|
|
18
|
+
effectQueue.length = 0;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const flushEffects = () => {
|
|
22
|
+
for (const effect of effectQueue.splice(0)) {
|
|
23
|
+
const cleanup = effect();
|
|
24
|
+
if (cleanup) effectCleanups.push(cleanup);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const tick = async () => {
|
|
29
|
+
await Promise.resolve();
|
|
30
|
+
await Promise.resolve();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
class FakeIntersectionObserver {
|
|
34
|
+
observed: Element[] = [];
|
|
35
|
+
|
|
36
|
+
constructor(private readonly callback: IntersectionObserverCallback) {
|
|
37
|
+
latestObserver = this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
observe = (element: Element) => {
|
|
41
|
+
this.observed.push(element);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
disconnect = () => {
|
|
45
|
+
this.observed = [];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
emit = (isIntersecting = true) => {
|
|
49
|
+
this.callback(
|
|
50
|
+
[{ isIntersecting, target: this.observed[0] ?? fakeElement } as IntersectionObserverEntry],
|
|
51
|
+
this as unknown as IntersectionObserver,
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const assignRef = (ref: unknown) => {
|
|
57
|
+
if (typeof ref === "function") {
|
|
58
|
+
ref(fakeElement);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (ref && typeof ref === "object" && "current" in ref) {
|
|
62
|
+
(ref as { current: Element | null }).current = fakeElement;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const createElement = (type: unknown, props: Record<string, unknown> = {}) => {
|
|
67
|
+
assignRef(props.ref);
|
|
68
|
+
return { type, props };
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
beforeAll(() => {
|
|
72
|
+
mock.module("react", () => ({
|
|
73
|
+
Fragment: ({ children }: { children: unknown }) => children,
|
|
74
|
+
useEffect: (effect: Effect) => {
|
|
75
|
+
effectQueue.push(effect);
|
|
76
|
+
},
|
|
77
|
+
useRef: <T,>(initial: T) => {
|
|
78
|
+
const index = hookIndex++;
|
|
79
|
+
if (!hookStates[index]) hookStates[index] = { current: initial };
|
|
80
|
+
return hookStates[index] as { current: T };
|
|
81
|
+
},
|
|
82
|
+
useState: <T,>(initial: T) => {
|
|
83
|
+
const index = hookIndex++;
|
|
84
|
+
if (hookStates[index] === undefined)
|
|
85
|
+
hookStates[index] = typeof initial === "function" ? (initial as () => T)() : initial;
|
|
86
|
+
const setState = (next: T | ((prev: T) => T)) => {
|
|
87
|
+
const prev = hookStates[index] as T;
|
|
88
|
+
hookStates[index] = typeof next === "function" ? (next as (value: T) => T)(prev) : next;
|
|
89
|
+
};
|
|
90
|
+
return [hookStates[index] as T, setState] as const;
|
|
91
|
+
},
|
|
92
|
+
}));
|
|
93
|
+
mock.module("react/jsx-dev-runtime", () => ({
|
|
94
|
+
Fragment: ({ children }: { children: unknown }) => children,
|
|
95
|
+
jsxDEV: createElement,
|
|
96
|
+
}));
|
|
97
|
+
mock.module("react/jsx-runtime", () => ({
|
|
98
|
+
Fragment: ({ children }: { children: unknown }) => children,
|
|
99
|
+
jsx: createElement,
|
|
100
|
+
jsxs: createElement,
|
|
101
|
+
}));
|
|
102
|
+
mock.module("react-icons/bi", () => ({
|
|
103
|
+
BiLoaderAlt: (props: Record<string, unknown>) => createElement("BiLoaderAlt", props),
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
afterEach(() => {
|
|
108
|
+
for (const cleanup of effectCleanups.splice(0)) cleanup();
|
|
109
|
+
latestObserver = undefined;
|
|
110
|
+
resetHooks();
|
|
111
|
+
Object.defineProperty(globalThis, "IntersectionObserver", {
|
|
112
|
+
value: originalIntersectionObserver,
|
|
113
|
+
configurable: true,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const renderInfiniteScroll = async (props: InfiniteScrollProps) => {
|
|
118
|
+
Object.defineProperty(globalThis, "IntersectionObserver", {
|
|
119
|
+
value: FakeIntersectionObserver,
|
|
120
|
+
configurable: true,
|
|
121
|
+
});
|
|
122
|
+
const { InfiniteScroll } = await import("./InfiniteScroll");
|
|
123
|
+
hookIndex = 0;
|
|
124
|
+
const result = InfiniteScroll(props);
|
|
125
|
+
flushEffects();
|
|
126
|
+
return result;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
describe("InfiniteScroll", () => {
|
|
130
|
+
test("loads the next page once when the sentinel intersects", async () => {
|
|
131
|
+
const addPageCalls: number[] = [];
|
|
132
|
+
const pageSelections: number[] = [];
|
|
133
|
+
|
|
134
|
+
await renderInfiniteScroll({
|
|
135
|
+
total: 30,
|
|
136
|
+
currentPage: 1,
|
|
137
|
+
itemsPerPage: 10,
|
|
138
|
+
onAddPage: async (page) => {
|
|
139
|
+
addPageCalls.push(page);
|
|
140
|
+
},
|
|
141
|
+
onPageSelect: (page) => {
|
|
142
|
+
pageSelections.push(page);
|
|
143
|
+
},
|
|
144
|
+
children: "items",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
expect(latestObserver?.observed).toHaveLength(1);
|
|
148
|
+
|
|
149
|
+
latestObserver?.emit();
|
|
150
|
+
await tick();
|
|
151
|
+
|
|
152
|
+
expect(addPageCalls).toEqual([2]);
|
|
153
|
+
expect(pageSelections).toEqual([2]);
|
|
154
|
+
});
|
|
155
|
+
});
|
package/ui/InfiniteScroll.tsx
CHANGED
package/ui/Input.tsx
CHANGED
|
@@ -66,7 +66,7 @@ export const Input = ({
|
|
|
66
66
|
: validateResult === false
|
|
67
67
|
? l("base.invalidValueError")
|
|
68
68
|
: validateResult;
|
|
69
|
-
|
|
69
|
+
// const invalidMessage = l("base.invalidValueError");
|
|
70
70
|
const statusClass =
|
|
71
71
|
inputStyleType === "bordered"
|
|
72
72
|
? status === "error"
|
|
@@ -117,6 +117,7 @@ export const Input = ({
|
|
|
117
117
|
className={clsx(
|
|
118
118
|
`b-5 text-base-content outline-hidden duration-300 focus:border-primary focus:outline-hidden ${icon && ""}`,
|
|
119
119
|
inputType,
|
|
120
|
+
// statusClass,
|
|
120
121
|
inputClassName,
|
|
121
122
|
)}
|
|
122
123
|
/>
|
|
@@ -589,9 +590,15 @@ const Number = ({
|
|
|
589
590
|
value={formatValue}
|
|
590
591
|
onKeyDown={handleKeyDown}
|
|
591
592
|
onBlur={(e) => {
|
|
593
|
+
// if (rest.max !== undefined && parsedValue > parseFloat(rest.max as string)) {
|
|
594
|
+
// e.target.value = formatter ? formatter(String(rest.max)) : String(rest.max);
|
|
595
|
+
// } else if (rest.min !== undefined && parsedValue < parseFloat(rest.min as string)) {
|
|
596
|
+
// e.target.value = formatter ? formatter(String(rest.min)) : String(rest.min);
|
|
597
|
+
// }
|
|
592
598
|
if (firstFocus && value) setFirstFocus(false);
|
|
593
599
|
}}
|
|
594
600
|
onChange={(e) => {
|
|
601
|
+
//string만 허용
|
|
595
602
|
const parsedValue = parser ? parser(e.target.value) : e.target.value;
|
|
596
603
|
setFormatValue(formatter ? formatter(parsedValue) : e.target.value);
|
|
597
604
|
onChange(parser ? parseFloat(parsedValue) : parseFloat(e.target.value), e);
|
package/ui/Layout/BottomTab.tsx
CHANGED
|
@@ -21,7 +21,7 @@ export interface BottomTabProps {
|
|
|
21
21
|
|
|
22
22
|
export const BottomTab = ({ className, tabs, height = 64 }: BottomTabProps) => {
|
|
23
23
|
const { lang, path } = usePage();
|
|
24
|
-
|
|
24
|
+
//ssr 에러나서 꼼짝없이 쓴거임. 페이지 이동에 대응안됨.
|
|
25
25
|
const [isRendered, setIsRendered] = useState<boolean>(false);
|
|
26
26
|
const isActiveTab = (tabHref: string) => {
|
|
27
27
|
if (!isRendered) return false;
|
|
@@ -56,7 +56,7 @@ export const BottomTab = ({ className, tabs, height = 64 }: BottomTabProps) => {
|
|
|
56
56
|
<div className="indicator">
|
|
57
57
|
{isActiveTab(tab.href) ? (tab.activeIcon ?? tab.icon) : tab.icon}
|
|
58
58
|
{tab.notiCount && tab.notiCount > 0 ? (
|
|
59
|
-
|
|
59
|
+
// <div className="absolute top-1 right-2 bg-error w-5 h-5 rounded-full flex items-center justify-center text-base-100">
|
|
60
60
|
<div className="indicator-item flex size-2 items-center justify-center rounded-full bg-secondary text-[10px] text-base-100">
|
|
61
61
|
{/* {tab.notiCount > 99 ? "99+" : tab.notiCount} */}
|
|
62
62
|
</div>
|
package/ui/Link/SsrLink.tsx
CHANGED
|
@@ -44,7 +44,8 @@ export default function SsrLink({
|
|
|
44
44
|
[activeClassName ?? ""]: activeExact ? currentPath === path : currentPath.startsWith(path),
|
|
45
45
|
})}
|
|
46
46
|
href={isExternal ? href : href.startsWith("#") ? href : requestHref}
|
|
47
|
-
|
|
47
|
+
// passHref
|
|
48
|
+
// replace={replace}
|
|
48
49
|
{...props}
|
|
49
50
|
onClick={(event) => {
|
|
50
51
|
props.onClick?.(event);
|
package/ui/Load/Page.tsx
CHANGED
|
@@ -29,7 +29,7 @@ const Page: <Return>(props: PageProps<Return>) => ReactNode =
|
|
|
29
29
|
error instanceof Error ? error.message : typeof error === "string" ? error : "Unknown error";
|
|
30
30
|
if (message === "NEXT_REDIRECT") reject(error);
|
|
31
31
|
else {
|
|
32
|
-
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
33
|
console.error(error);
|
|
34
34
|
resolve(<div className="text-red-500">{message}</div>);
|
|
35
35
|
}
|
package/ui/Load/PageCSR.tsx
CHANGED
package/ui/Load/Units.tsx
CHANGED
|
@@ -158,9 +158,10 @@ function Render<RefName extends string, Light extends { id: string }>({
|
|
|
158
158
|
},
|
|
159
159
|
onPageSelect: (page: number) => {
|
|
160
160
|
void storeDo[namesOfSlice.setPageOfModel](page);
|
|
161
|
-
|
|
161
|
+
// if (scrollToTop) {
|
|
162
162
|
window.parent.postMessage({ type: "pathChange", page }, "*");
|
|
163
163
|
window.scrollTo({ top: 0, behavior: "instant" });
|
|
164
|
+
// }
|
|
164
165
|
},
|
|
165
166
|
reverse,
|
|
166
167
|
};
|
package/ui/Load/View.tsx
CHANGED
|
@@ -78,6 +78,7 @@ function Render<T extends string, Full extends { id: string }>({
|
|
|
78
78
|
) : renderModel ? (
|
|
79
79
|
<div className={clsx("w-full", className)}>{renderView(renderModel)}</div>
|
|
80
80
|
) : null;
|
|
81
|
+
// <>{loading}</>
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
export default function View<T extends string, Full extends { id: string }>({
|
|
@@ -87,7 +88,7 @@ export default function View<T extends string, Full extends { id: string }>({
|
|
|
87
88
|
loading,
|
|
88
89
|
renderView,
|
|
89
90
|
}: ViewProps<T, Full>) {
|
|
90
|
-
|
|
91
|
+
//get Props
|
|
91
92
|
const props: ViewProps<T, Full> = {
|
|
92
93
|
className,
|
|
93
94
|
view,
|
package/ui/Menu.tsx
CHANGED
|
@@ -45,8 +45,8 @@ export const Menu = ({
|
|
|
45
45
|
onMouseOver,
|
|
46
46
|
onMouseLeave,
|
|
47
47
|
}: MenuProps) => {
|
|
48
|
-
const [expandedKey, setExpandedKey] = useState<string>();
|
|
49
|
-
const [currentKey, setCurrentKey] = useState<string | null>(defaultSelectedKeys?.[0] ?? null);
|
|
48
|
+
const [expandedKey, setExpandedKey] = useState<string>(); // 서브메뉴
|
|
49
|
+
const [currentKey, setCurrentKey] = useState<string | null>(defaultSelectedKeys?.[0] ?? null); // 선택된 메뉴
|
|
50
50
|
const modeClassName = mode === "horizontal" ? "menu-horizontal flex-row " : "bg-base-200";
|
|
51
51
|
const menuRef = useRef<HTMLDivElement | null>(null);
|
|
52
52
|
const LiRefs = useRef<HTMLLIElement[]>([]);
|
|
@@ -64,6 +64,7 @@ export const Menu = ({
|
|
|
64
64
|
? "w-full h-full bg-red-500 btn btn-ghost px-2 m-0 hover:bg-primary/20 btn btn-ghost text-primary-focus font-normal"
|
|
65
65
|
: "w-full text-center duration-300 whitespace-nowrap btn btn-ghost text-primary-focus font-normal";
|
|
66
66
|
|
|
67
|
+
// const activeClassName = activeStyle === "active" ? "[&>div]:bg-primary/20 [&>div]:text-primary-focus" : "bordered";
|
|
67
68
|
const activeClassName =
|
|
68
69
|
activeStyle === "active"
|
|
69
70
|
? "bg-primary text-primary-focus"
|
|
@@ -73,6 +74,7 @@ export const Menu = ({
|
|
|
73
74
|
|
|
74
75
|
const [overflowMenuItems, setOverflowMenuItems] = useState<MenuItem[]>([]);
|
|
75
76
|
|
|
77
|
+
// 초기화. 각각 아이템의 너비를 구함
|
|
76
78
|
useLayoutEffect(() => {
|
|
77
79
|
if (mode !== "horizontal") return;
|
|
78
80
|
const menu = menuRef.current;
|
|
@@ -86,6 +88,7 @@ export const Menu = ({
|
|
|
86
88
|
checkOverflow();
|
|
87
89
|
}, []);
|
|
88
90
|
|
|
91
|
+
// 브라우저 너비가 줄어들면, overflowMenuItems에 추가
|
|
89
92
|
useEffect(() => {
|
|
90
93
|
checkOverflow();
|
|
91
94
|
}, [innerWidth]);
|
|
@@ -94,7 +97,7 @@ export const Menu = ({
|
|
|
94
97
|
if (mode !== "horizontal" || !itemWidthsRef.current.length) return;
|
|
95
98
|
const menu = menuRef.current;
|
|
96
99
|
if (!menu) return;
|
|
97
|
-
|
|
100
|
+
// const overflowLiWidth = overflowLiRef?.current?.getBoundingClientRect().width || 0;
|
|
98
101
|
const totalWidth = menu.getBoundingClientRect().width;
|
|
99
102
|
const widths = itemWidthsRef.current;
|
|
100
103
|
const overflowItems: MenuItem[] = [];
|
|
@@ -219,7 +222,7 @@ interface OverflowMenuProps {
|
|
|
219
222
|
|
|
220
223
|
const OverflowMenu = ({ overflowItems, onClick }: OverflowMenuProps) => {
|
|
221
224
|
const [isOpen, setIsOpen] = useState(false);
|
|
222
|
-
const [expandedKey, setExpandedKey] = useState<string>();
|
|
225
|
+
const [expandedKey, setExpandedKey] = useState<string>(); // 서브메뉴
|
|
223
226
|
const handleMouseEnter = () => {
|
|
224
227
|
setIsOpen(true);
|
|
225
228
|
};
|
|
@@ -257,7 +260,7 @@ const OverflowMenu = ({ overflowItems, onClick }: OverflowMenuProps) => {
|
|
|
257
260
|
}}
|
|
258
261
|
key={child.key}
|
|
259
262
|
className="btn btn-ghost flex items-center justify-center text-center font-normal text-primary-focus"
|
|
260
|
-
|
|
263
|
+
// className="block font-normal text-center btn-sm text-primary-focus h-fit btn btn-ghost "
|
|
261
264
|
>
|
|
262
265
|
{child.label}
|
|
263
266
|
</div>
|
package/ui/Model/EditModal.tsx
CHANGED
|
@@ -80,6 +80,7 @@ const EditModel = <Full,>({
|
|
|
80
80
|
};
|
|
81
81
|
}, []);
|
|
82
82
|
|
|
83
|
+
// if (type === "empty") return null;
|
|
83
84
|
return <LoadingWrapper className={clsx("w-full", className)}>{children}</LoadingWrapper>;
|
|
84
85
|
};
|
|
85
86
|
|
|
@@ -180,18 +181,19 @@ export default function EditModal<Full extends { id: string }>({
|
|
|
180
181
|
[names.modelViewAt]: (modelEdit as any)[names.modelViewAt] as Date,
|
|
181
182
|
});
|
|
182
183
|
} else {
|
|
183
|
-
|
|
184
|
+
// new
|
|
184
185
|
const crystal = new modelRef().set(modelEdit as Full) as unknown as Full;
|
|
185
186
|
void storeDo[names.newModel](crystal, { modal, setDefault: true, sliceName });
|
|
186
187
|
}
|
|
187
188
|
return () => {
|
|
189
|
+
// st.do[names.resetModel]();
|
|
188
190
|
};
|
|
189
191
|
}, [modelEdit]);
|
|
190
192
|
|
|
191
193
|
const handleCancel = useCallback(() => {
|
|
192
194
|
const modelForm = (st.get() as any)[names.modelForm] as Full;
|
|
193
195
|
const form = deepObjectify({ ...modelForm });
|
|
194
|
-
|
|
196
|
+
// await st.do[names.resetModel]();
|
|
195
197
|
void storeDo[names.setModelModal](null);
|
|
196
198
|
if (typeof onCancel === "function") onCancel(form);
|
|
197
199
|
else if (onCancel === "back") router.back();
|
|
@@ -244,6 +246,7 @@ export default function EditModal<Full extends { id: string }>({
|
|
|
244
246
|
await handleSubmit({ onError });
|
|
245
247
|
}}
|
|
246
248
|
onSuccess={() => {
|
|
249
|
+
//
|
|
247
250
|
}}
|
|
248
251
|
>
|
|
249
252
|
{modelFormId ? <AiOutlineSave /> : <AiOutlinePlus />}
|
package/ui/Popconfirm.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useSpring } from "@react-spring/web";
|
|
3
|
-
|
|
3
|
+
// TODO: 디자인 수정, 테마 적용 안됨
|
|
4
4
|
import { clsx, usePage } from "akanjs/client";
|
|
5
5
|
import { type ButtonHTMLAttributes, type ReactNode, useEffect, useState } from "react";
|
|
6
6
|
import { BiMessageRoundedError } from "react-icons/bi";
|
|
@@ -56,16 +56,18 @@ export const Popconfirm = ({
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
// popconfirm 위치 조정 (x 좌표가 음수인 경우)
|
|
59
60
|
useEffect(() => {
|
|
60
61
|
const popconfirm = document.querySelector(".popconfirm");
|
|
61
62
|
const popconfirmRect = popconfirm?.getBoundingClientRect();
|
|
62
63
|
const popconfirmDeco = document.querySelector(".popconfirm-deco");
|
|
63
64
|
|
|
65
|
+
// popconfirmRect.x 가 좌측 화면 밖으로 나가는 경우
|
|
64
66
|
if (popconfirmRect && popconfirmRect.x < 0) {
|
|
65
67
|
popconfirm?.classList.add("left-0", "right-auto");
|
|
66
68
|
popconfirmDeco?.classList.add("left-10", "left-auto");
|
|
67
69
|
}
|
|
68
|
-
|
|
70
|
+
// popconfirmRect.x 가 우측 화면 밖으로 나가는 경우
|
|
69
71
|
if (popconfirmRect && popconfirmRect.x + popconfirmRect.width > window.innerWidth) {
|
|
70
72
|
popconfirm?.classList.add("left-auto", "right-0");
|
|
71
73
|
}
|
package/ui/ScreenNavigator.tsx
CHANGED
|
@@ -24,7 +24,7 @@ const ScreenNavigatorContext = createContext<ScreenNavigatorContextType>({
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
interface ScreenNavigatorProps {
|
|
27
|
-
|
|
27
|
+
// currentMenu: string;
|
|
28
28
|
children: React.ReactNode;
|
|
29
29
|
setMenu?: (menu: string) => void;
|
|
30
30
|
menus: string[];
|
|
@@ -33,6 +33,7 @@ interface ScreenNavigatorProps {
|
|
|
33
33
|
export const ScreenNavigator = ({
|
|
34
34
|
children,
|
|
35
35
|
setMenu = () => {
|
|
36
|
+
//
|
|
36
37
|
},
|
|
37
38
|
menus,
|
|
38
39
|
}: ScreenNavigatorProps) => {
|
|
@@ -50,7 +51,7 @@ export const ScreenNavigator = ({
|
|
|
50
51
|
const bind = useDrag(
|
|
51
52
|
({ first, last, offset: [x], velocity: [vx], direction: [dx], movement: [mx], cancel }) => {
|
|
52
53
|
if (!ref.current) return;
|
|
53
|
-
|
|
54
|
+
//! 메뉴가 3개 이상일 경우 고려해야함
|
|
54
55
|
const deviceWidth = ref.current.clientWidth / 2;
|
|
55
56
|
if (x > 0 || x < -deviceWidth) return;
|
|
56
57
|
if (dx < 1) {
|
package/ui/Signal/Message.tsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PrimitiveRegistry } from "akanjs/base";
|
|
3
|
-
|
|
3
|
+
// import { isGqlScalar } from "akanjs/base";
|
|
4
4
|
import { fetch, usePage } from "akanjs/client";
|
|
5
5
|
import { capitalize } from "akanjs/common";
|
|
6
6
|
import { type ConstantCls, ConstantRegistry } from "akanjs/constant";
|
|
7
7
|
import type { SerializedEndpoint } from "akanjs/signal";
|
|
8
|
-
|
|
8
|
+
// import { Cnst, constantInfo } from "akanjs/constant";
|
|
9
|
+
// import { fetch, makeRequestExample, SerializedEndpoint } from "akanjs/signal";
|
|
9
10
|
import { useEffect, useMemo, useState } from "react";
|
|
10
11
|
import { AiOutlineDisconnect, AiOutlineFileWord, AiOutlineSend, AiOutlineSwap } from "react-icons/ai";
|
|
11
12
|
import { BiSolidNetworkChart } from "react-icons/bi";
|
package/ui/Signal/PubSub.tsx
CHANGED
|
@@ -86,6 +86,8 @@ interface PubSubInterfaceProps {
|
|
|
86
86
|
refName: string;
|
|
87
87
|
endpointKey: string;
|
|
88
88
|
endpoint: SerializedEndpoint;
|
|
89
|
+
// gqlArgMetas: ArgMeta[];
|
|
90
|
+
// uploadArgMetas: ArgMeta[];
|
|
89
91
|
}
|
|
90
92
|
const PubSubInterface = ({ refName, endpointKey, endpoint }: PubSubInterfaceProps) => {
|
|
91
93
|
const returnRef = ConstantRegistry.getModelRef(endpoint.returns.refName, endpoint.returns.modelType);
|
package/ui/Signal/Response.tsx
CHANGED
package/ui/Signal/WebSocket.tsx
CHANGED
|
@@ -14,12 +14,21 @@ interface WebSocketEndpointsProps {
|
|
|
14
14
|
}
|
|
15
15
|
const WebSocketEndpoints = ({ refName, fetch, openAll }: WebSocketEndpointsProps) => {
|
|
16
16
|
const signal = fetch.serializedSignal[refName];
|
|
17
|
-
|
|
17
|
+
// const tryRoles = st.use.tryRoles();
|
|
18
18
|
const endpointEntries = Object.entries(signal.endpoint)
|
|
19
19
|
.sort(([keyA], [keyB]) => (keyA > keyB ? 1 : -1))
|
|
20
20
|
.filter(([key, endpoint]) => {
|
|
21
21
|
if (endpoint.type === "query" || endpoint.type === "mutation") return false;
|
|
22
|
-
|
|
22
|
+
// if (endpoint.guards?.includes("Public") && tryRoles.includes("Public")) return true;
|
|
23
|
+
// if ((endpoint.guards?.includes("User") || endpoint.guards?.includes("Every")) && tryRoles.includes("User"))
|
|
24
|
+
// return true;
|
|
25
|
+
// if ((endpoint.guards?.includes("Admin") || endpoint.guards?.includes("Every")) && tryRoles.includes("Admin"))
|
|
26
|
+
// return true;
|
|
27
|
+
// if (
|
|
28
|
+
// (endpoint.guards?.includes("SuperAdmin") || endpoint.guards?.includes("Every")) &&
|
|
29
|
+
// tryRoles.includes("SuperAdmin")
|
|
30
|
+
// )
|
|
31
|
+
// return true;
|
|
23
32
|
return false;
|
|
24
33
|
});
|
|
25
34
|
return (
|
package/ui/System/Client.tsx
CHANGED
|
@@ -54,10 +54,16 @@ export const ClientWrapper = ({
|
|
|
54
54
|
signals = [],
|
|
55
55
|
reconnect = true,
|
|
56
56
|
}: ClientWrapperProps) => {
|
|
57
|
-
|
|
57
|
+
// Seed the active locale into the shared Translator before children render.
|
|
58
|
+
// SSR provides the active-locale dictionary as a prop (serialized via the RSC Flight payload);
|
|
59
|
+
// this runs in both the SSR render process and the browser, so the first paint is translated
|
|
60
|
+
// without shipping every locale in the client JS bundle. CSR seeds via the build-time macro instead.
|
|
58
61
|
if (dictionary) {
|
|
59
62
|
Translator.seed(lang, dictionary);
|
|
60
|
-
|
|
63
|
+
// On the browser, record the server-resolved locale as the source of truth for usePage()/l().
|
|
64
|
+
// This keeps client lookups aligned with the seeded + server-rendered locale (no hydration
|
|
65
|
+
// mismatch) for base-path / cloud routing where the URL segment is not a reliable locale.
|
|
66
|
+
// Skipped on the server (typeof window === "undefined") where locale is request-scoped.
|
|
61
67
|
if (typeof window !== "undefined") Translator.setActiveLocale(lang);
|
|
62
68
|
}
|
|
63
69
|
useLayoutEffect(() => {
|
|
@@ -96,9 +102,9 @@ export const ClientPathWrapper = ({
|
|
|
96
102
|
}: ClientPathWrapperProps) => {
|
|
97
103
|
const href = location?.href ?? (typeof window !== "undefined" ? window.location.href : "");
|
|
98
104
|
const hash = location?.hash ?? (typeof window !== "undefined" ? window.location.hash : "");
|
|
99
|
-
const pathname = location?.pathname ?? "/";
|
|
100
|
-
const params = location?.params ?? {};
|
|
101
|
-
const searchParams = location?.searchParams ?? {};
|
|
105
|
+
const pathname = location?.pathname ?? "/"; // ?? usePathname();
|
|
106
|
+
const params = location?.params ?? {}; // ?? (useParams() as unknown as Record<string, string>);
|
|
107
|
+
const searchParams = location?.searchParams ?? {}; //?? Object.fromEntries(useSearchParams());
|
|
102
108
|
const search = location?.search ?? (typeof window !== "undefined" ? window.location.search : "");
|
|
103
109
|
const lang = params.lang;
|
|
104
110
|
const firstPath = pathname.split("/")[2];
|
|
@@ -111,8 +117,14 @@ export const ClientPathWrapper = ({
|
|
|
111
117
|
renderLayouts: [],
|
|
112
118
|
};
|
|
113
119
|
|
|
114
|
-
const
|
|
120
|
+
// const { initialize, codepush, statManager } = useCodepush({ serverUrl: process.env.AKAN_PUBLIC_SERVER_URL ?? "" });
|
|
115
121
|
|
|
122
|
+
const [gestureEnabled, setGestureEnabled] = useState(true);
|
|
123
|
+
// useEffect(() => {
|
|
124
|
+
// void initialize();
|
|
125
|
+
// void codepush();
|
|
126
|
+
// void statManager();
|
|
127
|
+
// }, []);
|
|
116
128
|
return (
|
|
117
129
|
<pathContext.Provider
|
|
118
130
|
value={{
|
|
@@ -161,10 +173,24 @@ export const ClientBridge = ({ env, lang, theme, prefix, gaTrackingId }: ClientB
|
|
|
161
173
|
const searchParams = st.use.searchParams();
|
|
162
174
|
const language = (params.lang as string | undefined) ?? lang;
|
|
163
175
|
const path = `/${pathname.split("/").slice(2).join("/")}`;
|
|
164
|
-
|
|
176
|
+
// const { setTheme, themes, theme: nextTheme } = useTheme();
|
|
165
177
|
useEffect(() => {
|
|
166
178
|
if (uiOperation !== "sleep") return;
|
|
179
|
+
// const initTheme = async () => {
|
|
180
|
+
// console.log("initTheme1", theme);
|
|
181
|
+
// if (theme) {
|
|
182
|
+
// setTheme(theme);
|
|
183
|
+
// return;
|
|
184
|
+
// }
|
|
185
|
+
// const localTheme = await storage.getItem("theme");
|
|
186
|
+
// console.log("localTheme2", localTheme);
|
|
187
|
+
// if (typeof localTheme === "string" && themes.includes(localTheme)) {
|
|
188
|
+
// console.log("setTheme3", localTheme);
|
|
189
|
+
// setTheme(localTheme);
|
|
190
|
+
// } else setTheme("system");
|
|
191
|
+
// };
|
|
167
192
|
|
|
193
|
+
// void initTheme();
|
|
168
194
|
setCookie("siteurl", window.location.origin);
|
|
169
195
|
dayjs.locale(language);
|
|
170
196
|
initAuth({ jwt: getBaseSearchParam(searchParams, "jwt") });
|
|
@@ -179,7 +205,15 @@ export const ClientBridge = ({ env, lang, theme, prefix, gaTrackingId }: ClientB
|
|
|
179
205
|
applyThemePolicy(theme ?? "system");
|
|
180
206
|
}, [theme]);
|
|
181
207
|
|
|
208
|
+
// useEffect(() => {
|
|
209
|
+
// if (storeTheme !== nextTheme) setTheme(storeTheme);
|
|
210
|
+
// }, [nextTheme]);
|
|
211
|
+
|
|
182
212
|
useEffect(() => {
|
|
213
|
+
//theme가 잇으면 theme부터
|
|
214
|
+
//theme가 있는데 nextTheme가 있으면
|
|
215
|
+
// if (nextTheme) setTheme(nextTheme);
|
|
216
|
+
// else if (theme) setTheme(theme);
|
|
183
217
|
}, []);
|
|
184
218
|
|
|
185
219
|
useEffect(() => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { createManifestDataUrl, toManifestJson } from "./Common";
|
|
3
|
+
|
|
4
|
+
describe("manifest helpers", () => {
|
|
5
|
+
test("converts author-facing camelCase keys to manifest snake_case", () => {
|
|
6
|
+
expect(
|
|
7
|
+
toManifestJson({
|
|
8
|
+
name: "Akan App",
|
|
9
|
+
shortName: "Akan",
|
|
10
|
+
startUrl: "/",
|
|
11
|
+
themeColor: "#ffffff",
|
|
12
|
+
backgroundColor: "#000000",
|
|
13
|
+
displayOverride: ["standalone"],
|
|
14
|
+
icons: [{ src: "/icon.png", sizes: "192x192", type: "image/png" }],
|
|
15
|
+
}),
|
|
16
|
+
).toEqual({
|
|
17
|
+
name: "Akan App",
|
|
18
|
+
short_name: "Akan",
|
|
19
|
+
start_url: "/",
|
|
20
|
+
theme_color: "#ffffff",
|
|
21
|
+
background_color: "#000000",
|
|
22
|
+
display_override: ["standalone"],
|
|
23
|
+
icons: [{ src: "/icon.png", sizes: "192x192", type: "image/png" }],
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("encodes manifest JSON as a base64 data URL", () => {
|
|
28
|
+
const href = createManifestDataUrl({ name: "Akan App", shortName: "Akan" });
|
|
29
|
+
expect(href.startsWith("data:application/manifest+json;base64,")).toBe(true);
|
|
30
|
+
|
|
31
|
+
const encoded = href.slice("data:application/manifest+json;base64,".length);
|
|
32
|
+
expect(JSON.parse(Buffer.from(encoded, "base64").toString("utf8"))).toEqual({
|
|
33
|
+
name: "Akan App",
|
|
34
|
+
short_name: "Akan",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
package/ui/System/Gtag.tsx
CHANGED
|
@@ -10,11 +10,12 @@ declare const window: {
|
|
|
10
10
|
export const Gtag = ({ trackingId, debugMode = false }: { trackingId: string; debugMode?: boolean }) => {
|
|
11
11
|
const pathname = st.use.pathname();
|
|
12
12
|
const searchParams = st.use.searchParams();
|
|
13
|
-
|
|
13
|
+
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
|
14
14
|
const pageview = (url: string) => {
|
|
15
15
|
window.gtag?.("config", trackingId, { page_path: url });
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
|
|
18
19
|
const event = ({
|
|
19
20
|
action,
|
|
20
21
|
category,
|
|
@@ -45,13 +46,15 @@ export const Gtag = ({ trackingId, debugMode = false }: { trackingId: string; de
|
|
|
45
46
|
} else urlSearchParams.set(key, value);
|
|
46
47
|
}
|
|
47
48
|
handleRouteChange(pathname + (urlSearchParams.size ? urlSearchParams.toString() : ""));
|
|
49
|
+
// const url = pathname + searchParams?.toString();
|
|
50
|
+
// handleRouteChange(url);
|
|
48
51
|
}, [pathname, searchParams]);
|
|
49
52
|
|
|
50
53
|
return (
|
|
51
54
|
<>
|
|
52
55
|
<script async src={`https://www.googletagmanager.com/gtag/js?id=${trackingId}`} />
|
|
53
56
|
<script
|
|
54
|
-
|
|
57
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
|
|
55
58
|
dangerouslySetInnerHTML={{
|
|
56
59
|
__html: `
|
|
57
60
|
window.dataLayer = window.dataLayer || [];
|
package/ui/System/Messages.tsx
CHANGED
|
@@ -15,7 +15,7 @@ type MessageType = "success" | "error" | "info" | "warning" | "loading";
|
|
|
15
15
|
interface MessageProps {
|
|
16
16
|
content: ReactNode;
|
|
17
17
|
type?: MessageType;
|
|
18
|
-
duration: number;
|
|
18
|
+
duration: number; // in seconds
|
|
19
19
|
keyForMessage: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -36,7 +36,7 @@ const Message = ({ content, type = "info" as MessageType, duration, keyForMessag
|
|
|
36
36
|
const [preBlind, setPreBlind] = useState(false);
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (!content) return;
|
|
39
|
-
|
|
39
|
+
// 기존의 timeouts에 key가 있으면, 기존의 timeout을 제거하고 새로운 timeout을 추가한다.
|
|
40
40
|
const existingTimeOut = timeOuts.find((item) => item.key === keyForMessage);
|
|
41
41
|
if (existingTimeOut) {
|
|
42
42
|
clearTimeout(existingTimeOut.timeoutId);
|