@oj-module/cli 0.2.64 → 0.2.67
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/bin/.oj-version +1 -0
- package/bin/oj +4 -0
- package/devkit/README.md +18 -4
- package/devkit/SKILL.md +35 -3
- package/devkit/framework-dev.md +22 -11
- package/devkit/manual.md +161 -68
- package/devkit/menu-rules.md +4 -1
- package/devkit/publish-walkthrough.md +110 -37
- package/devkit/wecom-internal-app.md +7 -2
- package/devkit/wecom-multi-corp-links.md +163 -0
- package/package.json +3 -2
- package/shell-dist/assets/ahooks.2l850ymmh0.js +18 -0
- package/shell-dist/assets/antd-es-locale-zh_CN.1gjjsvxbf0.js +1 -0
- package/shell-dist/assets/antd-img-crop.196rkty480.js +99 -0
- package/shell-dist/assets/antd-locale-en_US.561tozx860.js +1 -0
- package/shell-dist/assets/antd-locale-zh_CN.1cmpmgzh70.js +1 -0
- package/shell-dist/assets/antd.uw1coq15l0.js +348 -0
- package/shell-dist/assets/clsx.jotilrt2e0.js +1 -0
- package/shell-dist/assets/contract-errors.2o17vz9u50.js +1 -0
- package/shell-dist/assets/contract.3h327o3mj0.js +57 -0
- package/shell-dist/assets/cssinjs.atgmhan7m0.js +3 -0
- package/shell-dist/assets/dayjs-plugin-advancedFormat.3vsyd2eis0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-customParseFormat.13xhghv1d0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-isoWeek.1fn1tw82p0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-localeData.2rwbjp9nk0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-quarterOfYear.2oqo1lcx80.js +1 -0
- package/shell-dist/assets/dayjs-plugin-relativeTime.2pqs3et4y0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekOfYear.gvn9iph080.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekYear.2u78l3ex10.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekday.2d56a4tml0.js +1 -0
- package/shell-dist/assets/dayjs.pa60l6wjo0.js +1 -0
- package/shell-dist/assets/dnd-kit-core.1xyreig6r0.js +5 -0
- package/shell-dist/assets/dnd-kit-sortable.s94qciuft0.js +1 -0
- package/shell-dist/assets/dnd-kit-utilities.1umw4xphb0.js +1 -0
- package/shell-dist/assets/i18next.33zqofapj0.js +1 -0
- package/shell-dist/assets/icons-es-components-Context.365qmflwg0.js +1 -0
- package/shell-dist/assets/icons.159wjwals0.js +57 -0
- package/shell-dist/assets/{index-xZhmujjM.js → index.6alqyx6ae0.js} +21 -1
- package/shell-dist/assets/jsx-dev-runtime.3uibuc82f0.js +14 -0
- package/shell-dist/assets/jsx-runtime.h40xu4o5b0.js +14 -0
- package/shell-dist/assets/keepalive-for-react.xenu5vam70.js +1 -0
- package/shell-dist/assets/kit.37kr8ui390.js +1 -0
- package/shell-dist/assets/ky.1cgch7gu60.js +6 -0
- package/shell-dist/assets/motion-react.pjsxytvjs0.js +12 -0
- package/shell-dist/assets/motion.21tciqutg0.js +4 -0
- package/shell-dist/assets/nprogress.2nz76n9ny0.js +7 -0
- package/shell-dist/assets/ojm-dayjs-locale-zh-cn.3vr3beiyp0.js +9 -0
- package/shell-dist/assets/pinyin-pro.3v0mnxczn0.js +1 -0
- package/shell-dist/assets/pro-components.2kyot1vcl0.js +83 -0
- package/shell-dist/assets/react-countup.2x8idnr8y0.js +10 -0
- package/shell-dist/assets/react-dom-client.ick0v05ob0.js +43 -0
- package/shell-dist/assets/react-dom.2so9uxg3f0.js +22 -0
- package/shell-dist/assets/react-error-boundary.2dncdfj3b0.js +1 -0
- package/shell-dist/assets/react-i18next.auhvjhqv00.js +1 -0
- package/shell-dist/assets/react-jss.1ei6dr9e00.js +29 -0
- package/shell-dist/assets/react-query.3rln45ow00.js +1 -0
- package/shell-dist/assets/react-router-dom.3c6zld8h40.js +44 -0
- package/shell-dist/assets/react-router.2h9rebcv50.js +56 -0
- package/shell-dist/assets/react.1ew63mwts0.js +14 -0
- package/shell-dist/assets/runtime.2dgstpjsu0.js +21702 -0
- package/shell-dist/assets/simplebar-react.2g739uvai0.js +1 -0
- package/shell-dist/assets/spin-delay.yjeyj6iwp0.js +9 -0
- package/shell-dist/assets/tailwind-merge.125ehiqjw0.js +1 -0
- package/shell-dist/assets/use-sync-external-store-shim.1nz1pi9bb0.js +22 -0
- package/shell-dist/assets/zustand-middleware.1xaxjueme0.js +6 -0
- package/shell-dist/assets/zustand-react-shallow.pybayv1hx0.js +1 -0
- package/shell-dist/assets/zustand-react.9fsl9brxy0.js +1 -0
- package/shell-dist/assets/zustand-shallow.6cz0yyv9x0.js +1 -0
- package/shell-dist/assets/zustand-vanilla-shallow.3424monv50.js +1 -0
- package/shell-dist/assets/zustand-vanilla.1mo3ka3g30.js +1 -0
- package/shell-dist/assets/zustand.3gjgzlnqo0.js +1 -0
- package/shell-dist/index.html +67 -118
- package/shell-dist/versions.json +3 -3
- package/src/__tests__/publish-keygen.test.ts +157 -0
- package/src/__tests__/templates-migration-schema-parity.test.ts +540 -0
- package/src/__tests__/templates-schema-columns.test.ts +15 -2
- package/src/__tests__/templates-tenant-scope.test.ts +6 -2
- package/src/bundle.ts +8 -3
- package/src/cli.ts +17 -5
- package/src/dev.ts +15 -10
- package/src/esm-exports.ts +152 -70
- package/src/install.ts +11 -4
- package/src/keygen.ts +54 -0
- package/src/lifecycle/__tests__/bundle.test.ts +21 -3
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/manifest.yaml +1 -1
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/migrations/0001__init.sql +2 -2
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/schema.yaml +5 -2
- package/src/lifecycle/__tests__/fixtures/fixture-valid/manifest.yaml +1 -1
- package/src/lifecycle/__tests__/manifest-contract.test.ts +75 -3
- package/src/lifecycle/__tests__/smoke.test.ts +2 -2
- package/src/manifest-contract.ts +91 -8
- package/src/market/bootstrap.ts +26 -2
- package/src/market/command.ts +1 -0
- package/src/market/publish.ts +5 -1
- package/src/market/walkthrough.ts +24 -8
- package/src/shared-deps.ts +69 -19
- package/src/site-base.ts +4 -0
- package/src/site.ts +2 -0
- package/src/usage.ts +8 -4
- package/src/vendor.ts +5 -1
- package/templates/config.yaml +4 -2
- package/templates/init.include.yaml +8 -3
- package/templates/openapi.json +460 -1
- package/templates/src/app/api/_platform/_lifecycle/compensate.ts +136 -0
- package/templates/src/app/api/_platform/_lifecycle/installer.ts +71 -22
- package/templates/src/app/api/_platform/_lifecycle/lock.ts +23 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/deploy-web.ts +28 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/preflight.ts +46 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/reload.ts +100 -36
- package/templates/src/app/api/_platform/_lifecycle/steps/smoke.ts +7 -15
- package/templates/src/app/api/_platform/_lifecycle/text-edit.ts +71 -19
- package/templates/src/app/api/_platform/_lifecycle/types.ts +26 -2
- package/templates/src/app/api/_platform/_lifecycle/uninstall.ts +93 -14
- package/templates/src/app/api/_platform/_shared/service/domain/settings.ts +8 -4
- package/templates/src/app/api/_platform/manifest.yaml +1 -0
- package/templates/src/app/api/_platform/market/api.ts +235 -10
- package/templates/src/app/api/_platform/migrations/0001__baseline.mysql.sql +178 -0
- package/templates/src/app/api/_platform/migrations/0001__baseline.pg.sql +173 -0
- package/templates/src/app/api/_platform/migrations/0001__baseline.sql +188 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.mysql.sql +17 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.pg.sql +16 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.sql +33 -0
- package/templates/src/app/api/_platform/schema.yaml +18 -0
- package/templates/src/app/api/_platform/seed.mysql.sql +10 -0
- package/templates/src/app/api/_platform/seed.pg.sql +10 -0
- package/templates/src/app/api/auth/_shared/wecom/client.ts +24 -4
- package/templates/src/app/api/home/migrations/0001__create_home_tables.mysql.sql +14 -0
- package/templates/src/app/api/home/migrations/0001__create_home_tables.pg.sql +14 -0
- package/templates/src/app/api/home/migrations/0002__tenant.pg.sql +4 -0
- package/templates/src/app/api/home/seed.mysql.sql +71 -0
- package/templates/src/app/api/home/seed.pg.sql +71 -0
- package/templates/src/app/api/notification/_shared/notify.ts +6 -6
- package/templates/src/app/api/notification/migrations/0001__create_notifications.mysql.sql +11 -0
- package/templates/src/app/api/notification/migrations/0001__create_notifications.pg.sql +11 -0
- package/templates/src/app/api/notification/migrations/0002__notifications_user.mysql.sql +8 -0
- package/templates/src/app/api/notification/migrations/0003__notifications_broadcast.mysql.sql +21 -0
- package/templates/src/app/api/notification/migrations/0003__notifications_broadcast.pg.sql +22 -0
- package/templates/src/app/api/notification/migrations/0004__notifications_broadcast_hidden.mysql.sql +10 -0
- package/templates/src/app/api/notification/migrations/0004__notifications_broadcast_hidden.pg.sql +11 -0
- package/templates/src/app/api/notification/migrations/0005__tenant.pg.sql +6 -0
- package/templates/src/app/api/notification/seed.mysql.sql +8 -0
- package/templates/src/app/api/notification/seed.pg.sql +11 -0
- package/templates/src/app/api/publish/_shared/identity.ts +69 -0
- package/templates/src/app/api/publish/api.ts +349 -0
- package/templates/src/app/api/publish/manifest.yaml +8 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.mysql.sql +23 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.pg.sql +23 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.sql +39 -0
- package/templates/src/app/api/publish/schema.yaml +33 -0
- package/templates/src/app/api/system/login-methods/api.ts +2 -1
- package/templates/src/app/web/_platform/__client/api.schemas.ts +15 -0
- package/templates/src/app/web/_platform/__client/index.ts +25 -1
- package/templates/src/app/web/entry.ts +9 -5
- package/templates/src/app/web/home/pages/components/bar-chart.tsx +5 -3
- package/templates/src/app/web/home/pages/components/echarts-setup.ts +30 -0
- package/templates/src/app/web/home/pages/components/line-chart.tsx +5 -3
- package/templates/src/app/web/home/pages/components/pie-chart.tsx +6 -3
- package/templates/src/app/web/home/pages/index.tsx +3 -2
- package/templates/src/app/web/home/routes.ts +8 -2
- package/templates/src/app/web/login/locales/en-US.json +7 -1
- package/templates/src/app/web/login/locales/zh-CN.json +7 -1
- package/templates/src/app/web/login/pages/login.tsx +79 -86
- package/templates/src/app/web/login/routes.ts +54 -1
- package/templates/src/app/web/personal-center/locales/en-US.json +1 -0
- package/templates/src/app/web/personal-center/locales/zh-CN.json +1 -0
- package/templates/src/app/web/personal-center/pages/my-profile/index.tsx +5 -0
- package/templates/src/app/web/system/__client/api.schemas.ts +2 -1
- package/templates/src/app/web/system/locales/en-US.json +1 -8
- package/templates/src/app/web/system/locales/zh-CN.json +1 -8
- package/templates/src/app/web/system/pages/settings/index.tsx +17 -4
- package/templates/src/app/web/system/routes.ts +0 -6
- package/templates/src/oj-market/web/__tests__/CardGrid.test.tsx +33 -0
- package/templates/src/oj-market/web/__tests__/DetailDrawer.test.tsx +69 -0
- package/templates/src/oj-market/web/__tests__/marketClient.fake.ts +7 -1
- package/templates/src/oj-market/web/api/client.ts +3 -0
- package/templates/src/oj-market/web/api/defaultClient.ts +5 -0
- package/templates/src/oj-market/web/components/CardItem.tsx +44 -1
- package/templates/src/oj-market/web/components/DetailDrawer.tsx +17 -1
- package/templates/src/oj-market/web/entry.ts +31 -2
- package/templates/src/oj-market/web/locales/en-US.json +5 -1
- package/templates/src/oj-market/web/locales/zh-CN.json +5 -1
- package/templates/src/oj-market/web/publish/__client/api.schemas.ts +61 -0
- package/templates/src/oj-market/web/publish/__client/index.ts +164 -0
- package/templates/src/oj-market/web/publish/locales/en-US.json +80 -0
- package/templates/src/oj-market/web/publish/locales/zh-CN.json +80 -0
- package/templates/src/oj-market/web/publish/pages/history.tsx +112 -0
- package/templates/src/oj-market/web/publish/pages/index.tsx +196 -0
- package/templates/src/oj-market/web/publish/pages/model.ts +52 -0
- package/templates/src/oj-market/web/publish/pages/token-modal.tsx +82 -0
- package/templates/src/oj-market/web/publish/routes.ts +41 -0
- package/templates/src/oj-market/web/types.ts +30 -0
- package/templates/tests/lifecycle/compensate.spec.ts +207 -0
- package/templates/tests/lifecycle/deploy-smoke.spec.ts +38 -14
- package/templates/tests/lifecycle/installer.spec.ts +28 -9
- package/templates/tests/lifecycle/market-api.spec.ts +164 -12
- package/templates/tests/lifecycle/preflight.spec.ts +68 -0
- package/templates/tests/lifecycle/role-title-translate.spec.ts +2 -32
- package/templates/tests/lifecycle/text-edit.spec.ts +45 -27
- package/templates/tests/lifecycle/uninstall.spec.ts +36 -0
- package/templates/tests/publish-credential.spec.ts +354 -0
- package/templates/tests/publish-identity.spec.ts +44 -0
- package/templates/tests/wecom-client-timeout.spec.ts +33 -3
- package/templates/tests/wecom-landing.spec.ts +63 -1
- package/templates/tsconfig.paths.json +1 -0
- package/templates/web.config.ts +6 -4
- package/vendor/host-versions.json +3 -3
- package/shell-dist/assets/ahooks.js +0 -6909
- package/shell-dist/assets/antd-es-locale-zh_CN.js +0 -257
- package/shell-dist/assets/antd-img-crop.js +0 -1495
- package/shell-dist/assets/antd-locale-en_US.js +0 -374
- package/shell-dist/assets/antd-locale-zh_CN.js +0 -379
- package/shell-dist/assets/antd.js +0 -106874
- package/shell-dist/assets/clsx.js +0 -33
- package/shell-dist/assets/contract-errors.js +0 -30
- package/shell-dist/assets/contract.js +0 -18900
- package/shell-dist/assets/cssinjs.js +0 -2595
- package/shell-dist/assets/dayjs-plugin-advancedFormat.js +0 -98
- package/shell-dist/assets/dayjs-plugin-customParseFormat.js +0 -173
- package/shell-dist/assets/dayjs-plugin-isoWeek.js +0 -77
- package/shell-dist/assets/dayjs-plugin-localeData.js +0 -126
- package/shell-dist/assets/dayjs-plugin-quarterOfYear.js +0 -77
- package/shell-dist/assets/dayjs-plugin-relativeTime.js +0 -92
- package/shell-dist/assets/dayjs-plugin-weekOfYear.js +0 -73
- package/shell-dist/assets/dayjs-plugin-weekYear.js +0 -63
- package/shell-dist/assets/dayjs-plugin-weekday.js +0 -63
- package/shell-dist/assets/dayjs.js +0 -326
- package/shell-dist/assets/dnd-kit-core.js +0 -3601
- package/shell-dist/assets/dnd-kit-sortable.js +0 -717
- package/shell-dist/assets/dnd-kit-utilities.js +0 -340
- package/shell-dist/assets/i18next.js +0 -2321
- package/shell-dist/assets/icons-es-components-Context.js +0 -20
- package/shell-dist/assets/icons.js +0 -34961
- package/shell-dist/assets/jsx-dev-runtime.js +0 -75
- package/shell-dist/assets/jsx-runtime.js +0 -97
- package/shell-dist/assets/keepalive-for-react.js +0 -283
- package/shell-dist/assets/kit.js +0 -151
- package/shell-dist/assets/ky.js +0 -1427
- package/shell-dist/assets/motion-react.js +0 -13589
- package/shell-dist/assets/motion.js +0 -9959
- package/shell-dist/assets/nprogress.js +0 -314
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-BarsOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CalendarOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretUpOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ClockCircleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CopyOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DeleteOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleLeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownloadOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EditOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EllipsisOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EnterOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ExclamationCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeInvisibleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileTextOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FilterFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOpenOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-HolderOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-InfoCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-LeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-LoadingOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusSquareOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PaperClipOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PictureOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusSquareOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-QuestionCircleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ReloadOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateLeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SearchOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-StarFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-UpOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-VerticalAlignTopOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-WarningFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomInOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomOutOutlined.js +0 -7
- package/shell-dist/assets/ojm-dayjs-locale-zh-cn.js +0 -81
- package/shell-dist/assets/pinyin-pro.js +0 -25175
- package/shell-dist/assets/pro-components.js +0 -44627
- package/shell-dist/assets/react-countup.js +0 -525
- package/shell-dist/assets/react-dom-client.js +0 -12134
- package/shell-dist/assets/react-dom.js +0 -266
- package/shell-dist/assets/react-error-boundary.js +0 -141
- package/shell-dist/assets/react-i18next.js +0 -1773
- package/shell-dist/assets/react-jss.js +0 -4089
- package/shell-dist/assets/react-query.js +0 -3072
- package/shell-dist/assets/react-router-dom.js +0 -9927
- package/shell-dist/assets/react-router.js +0 -14584
- package/shell-dist/assets/react.js +0 -590
- package/shell-dist/assets/runtime.js +0 -28311
- package/shell-dist/assets/simplebar-react.js +0 -1119
- package/shell-dist/assets/spin-delay.js +0 -111
- package/shell-dist/assets/tailwind-merge.js +0 -3364
- package/shell-dist/assets/use-sync-external-store-shim.js +0 -130
- package/shell-dist/assets/zustand-middleware.js +0 -513
- package/shell-dist/assets/zustand-react-shallow.js +0 -27
- package/shell-dist/assets/zustand-react.js +0 -39
- package/shell-dist/assets/zustand-shallow.js +0 -22
- package/shell-dist/assets/zustand-vanilla-shallow.js +0 -71
- package/shell-dist/assets/zustand-vanilla.js +0 -40
- package/shell-dist/assets/zustand.js +0 -32
- package/templates/seed.mysql.sql +0 -6
- package/templates/seed.pg.sql +0 -6
- package/templates/src/app/api/_platform/migrations/0001__create_users.mysql.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0001__create_users.pg.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0001__create_users.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0002__add_users_avatar_base64.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0002__add_users_avatar_base64.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0003__users_source_display_name.mysql.sql +0 -5
- package/templates/src/app/api/_platform/migrations/0003__users_source_display_name.sql +0 -5
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.mysql.sql +0 -70
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.pg.sql +0 -67
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.sql +0 -67
- package/templates/src/app/api/_platform/migrations/0005__users_must_change.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0005__users_must_change.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0006__users_is_forbidden.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0006__users_is_forbidden.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0007__users_email.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.mysql.sql +0 -10
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.pg.sql +0 -10
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.sql +0 -11
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.mysql.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.pg.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.sql +0 -13
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.mysql.sql +0 -17
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.pg.sql +0 -16
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.sql +0 -18
- package/templates/src/app/api/_platform/migrations/0011__sys_setting_group_label.mysql.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0011__sys_setting_group_label.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0012__market_history.mysql.sql +0 -13
- package/templates/src/app/api/_platform/migrations/0012__market_history.pg.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0012__market_history.sql +0 -14
- package/templates/src/app/api/_platform/migrations/0013__users_profile.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.mysql.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.pg.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.sql +0 -8
- package/templates/src/app/api/_platform/migrations/0015__tenant.mysql.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0015__tenant.pg.sql +0 -11
- package/templates/src/app/api/_platform/migrations/0015__tenant.sql +0 -44
- package/templates/src/app/api/_platform/migrations/0016__org.mysql.sql +0 -41
- package/templates/src/app/api/_platform/migrations/0016__org.pg.sql +0 -40
- package/templates/src/app/api/_platform/migrations/0016__org.sql +0 -62
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.mysql.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.pg.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.sql +0 -8
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.pg.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.sql +0 -8
- package/templates/src/app/web/system/pages/login-methods/index.tsx +0 -30
- /package/shell-dist/assets/{nprogress-css.js → nprogress-css.1cq2pzkre0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-button.js → ojm-antd-es-button.2uriphio50.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-modal.js → ojm-antd-es-modal.bf3tgdh8v0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-slider.js → ojm-antd-es-slider.xyvptuhid0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-upload.js → ojm-antd-es-upload.13gx45e0g0.js} +0 -0
|
@@ -1,717 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// ../../node_modules/.pnpm/@dnd-kit+sortable@10.0.0_@dnd-kit+core@6.3.1_react-dom@19.2.8_react@19.2.8__react@19.2.8__react@19.2.8/node_modules/@dnd-kit/sortable/dist/sortable.esm.js
|
|
8
|
-
var sortable_esm_exports = {};
|
|
9
|
-
__export(sortable_esm_exports, {
|
|
10
|
-
SortableContext: () => SortableContext,
|
|
11
|
-
arrayMove: () => arrayMove,
|
|
12
|
-
arraySwap: () => arraySwap,
|
|
13
|
-
defaultAnimateLayoutChanges: () => defaultAnimateLayoutChanges,
|
|
14
|
-
defaultNewIndexGetter: () => defaultNewIndexGetter,
|
|
15
|
-
hasSortableData: () => hasSortableData,
|
|
16
|
-
horizontalListSortingStrategy: () => horizontalListSortingStrategy,
|
|
17
|
-
rectSortingStrategy: () => rectSortingStrategy,
|
|
18
|
-
rectSwappingStrategy: () => rectSwappingStrategy,
|
|
19
|
-
sortableKeyboardCoordinates: () => sortableKeyboardCoordinates,
|
|
20
|
-
useSortable: () => useSortable,
|
|
21
|
-
verticalListSortingStrategy: () => verticalListSortingStrategy
|
|
22
|
-
});
|
|
23
|
-
import React, { useMemo, useRef, useEffect, useState, useContext } from "react";
|
|
24
|
-
import { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from "@dnd-kit/core";
|
|
25
|
-
import { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from "@dnd-kit/utilities";
|
|
26
|
-
function arrayMove(array, from, to) {
|
|
27
|
-
const newArray = array.slice();
|
|
28
|
-
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
|
|
29
|
-
return newArray;
|
|
30
|
-
}
|
|
31
|
-
function arraySwap(array, from, to) {
|
|
32
|
-
const newArray = array.slice();
|
|
33
|
-
newArray[from] = array[to];
|
|
34
|
-
newArray[to] = array[from];
|
|
35
|
-
return newArray;
|
|
36
|
-
}
|
|
37
|
-
function getSortedRects(items, rects) {
|
|
38
|
-
return items.reduce((accumulator, id, index) => {
|
|
39
|
-
const rect = rects.get(id);
|
|
40
|
-
if (rect) {
|
|
41
|
-
accumulator[index] = rect;
|
|
42
|
-
}
|
|
43
|
-
return accumulator;
|
|
44
|
-
}, Array(items.length));
|
|
45
|
-
}
|
|
46
|
-
function isValidIndex(index) {
|
|
47
|
-
return index !== null && index >= 0;
|
|
48
|
-
}
|
|
49
|
-
function itemsEqual(a, b) {
|
|
50
|
-
if (a === b) {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
if (a.length !== b.length) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
for (let i = 0; i < a.length; i++) {
|
|
57
|
-
if (a[i] !== b[i]) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
function normalizeDisabled(disabled) {
|
|
64
|
-
if (typeof disabled === "boolean") {
|
|
65
|
-
return {
|
|
66
|
-
draggable: disabled,
|
|
67
|
-
droppable: disabled
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return disabled;
|
|
71
|
-
}
|
|
72
|
-
var defaultScale = {
|
|
73
|
-
scaleX: 1,
|
|
74
|
-
scaleY: 1
|
|
75
|
-
};
|
|
76
|
-
var horizontalListSortingStrategy = (_ref) => {
|
|
77
|
-
var _rects$activeIndex;
|
|
78
|
-
let {
|
|
79
|
-
rects,
|
|
80
|
-
activeNodeRect: fallbackActiveRect,
|
|
81
|
-
activeIndex,
|
|
82
|
-
overIndex,
|
|
83
|
-
index
|
|
84
|
-
} = _ref;
|
|
85
|
-
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
|
|
86
|
-
if (!activeNodeRect) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
const itemGap = getItemGap(rects, index, activeIndex);
|
|
90
|
-
if (index === activeIndex) {
|
|
91
|
-
const newIndexRect = rects[overIndex];
|
|
92
|
-
if (!newIndexRect) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
|
|
97
|
-
y: 0,
|
|
98
|
-
...defaultScale
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
if (index > activeIndex && index <= overIndex) {
|
|
102
|
-
return {
|
|
103
|
-
x: -activeNodeRect.width - itemGap,
|
|
104
|
-
y: 0,
|
|
105
|
-
...defaultScale
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
if (index < activeIndex && index >= overIndex) {
|
|
109
|
-
return {
|
|
110
|
-
x: activeNodeRect.width + itemGap,
|
|
111
|
-
y: 0,
|
|
112
|
-
...defaultScale
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
x: 0,
|
|
117
|
-
y: 0,
|
|
118
|
-
...defaultScale
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
function getItemGap(rects, index, activeIndex) {
|
|
122
|
-
const currentRect = rects[index];
|
|
123
|
-
const previousRect = rects[index - 1];
|
|
124
|
-
const nextRect = rects[index + 1];
|
|
125
|
-
if (!currentRect || !previousRect && !nextRect) {
|
|
126
|
-
return 0;
|
|
127
|
-
}
|
|
128
|
-
if (activeIndex < index) {
|
|
129
|
-
return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
|
|
130
|
-
}
|
|
131
|
-
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
|
|
132
|
-
}
|
|
133
|
-
var rectSortingStrategy = (_ref) => {
|
|
134
|
-
let {
|
|
135
|
-
rects,
|
|
136
|
-
activeIndex,
|
|
137
|
-
overIndex,
|
|
138
|
-
index
|
|
139
|
-
} = _ref;
|
|
140
|
-
const newRects = arrayMove(rects, overIndex, activeIndex);
|
|
141
|
-
const oldRect = rects[index];
|
|
142
|
-
const newRect = newRects[index];
|
|
143
|
-
if (!newRect || !oldRect) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
x: newRect.left - oldRect.left,
|
|
148
|
-
y: newRect.top - oldRect.top,
|
|
149
|
-
scaleX: newRect.width / oldRect.width,
|
|
150
|
-
scaleY: newRect.height / oldRect.height
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
var rectSwappingStrategy = (_ref) => {
|
|
154
|
-
let {
|
|
155
|
-
activeIndex,
|
|
156
|
-
index,
|
|
157
|
-
rects,
|
|
158
|
-
overIndex
|
|
159
|
-
} = _ref;
|
|
160
|
-
let oldRect;
|
|
161
|
-
let newRect;
|
|
162
|
-
if (index === activeIndex) {
|
|
163
|
-
oldRect = rects[index];
|
|
164
|
-
newRect = rects[overIndex];
|
|
165
|
-
}
|
|
166
|
-
if (index === overIndex) {
|
|
167
|
-
oldRect = rects[index];
|
|
168
|
-
newRect = rects[activeIndex];
|
|
169
|
-
}
|
|
170
|
-
if (!newRect || !oldRect) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
x: newRect.left - oldRect.left,
|
|
175
|
-
y: newRect.top - oldRect.top,
|
|
176
|
-
scaleX: newRect.width / oldRect.width,
|
|
177
|
-
scaleY: newRect.height / oldRect.height
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
var defaultScale$1 = {
|
|
181
|
-
scaleX: 1,
|
|
182
|
-
scaleY: 1
|
|
183
|
-
};
|
|
184
|
-
var verticalListSortingStrategy = (_ref) => {
|
|
185
|
-
var _rects$activeIndex;
|
|
186
|
-
let {
|
|
187
|
-
activeIndex,
|
|
188
|
-
activeNodeRect: fallbackActiveRect,
|
|
189
|
-
index,
|
|
190
|
-
rects,
|
|
191
|
-
overIndex
|
|
192
|
-
} = _ref;
|
|
193
|
-
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
|
|
194
|
-
if (!activeNodeRect) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
if (index === activeIndex) {
|
|
198
|
-
const overIndexRect = rects[overIndex];
|
|
199
|
-
if (!overIndexRect) {
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
return {
|
|
203
|
-
x: 0,
|
|
204
|
-
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
|
|
205
|
-
...defaultScale$1
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
const itemGap = getItemGap$1(rects, index, activeIndex);
|
|
209
|
-
if (index > activeIndex && index <= overIndex) {
|
|
210
|
-
return {
|
|
211
|
-
x: 0,
|
|
212
|
-
y: -activeNodeRect.height - itemGap,
|
|
213
|
-
...defaultScale$1
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
if (index < activeIndex && index >= overIndex) {
|
|
217
|
-
return {
|
|
218
|
-
x: 0,
|
|
219
|
-
y: activeNodeRect.height + itemGap,
|
|
220
|
-
...defaultScale$1
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
return {
|
|
224
|
-
x: 0,
|
|
225
|
-
y: 0,
|
|
226
|
-
...defaultScale$1
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
function getItemGap$1(clientRects, index, activeIndex) {
|
|
230
|
-
const currentRect = clientRects[index];
|
|
231
|
-
const previousRect = clientRects[index - 1];
|
|
232
|
-
const nextRect = clientRects[index + 1];
|
|
233
|
-
if (!currentRect) {
|
|
234
|
-
return 0;
|
|
235
|
-
}
|
|
236
|
-
if (activeIndex < index) {
|
|
237
|
-
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
|
|
238
|
-
}
|
|
239
|
-
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
|
|
240
|
-
}
|
|
241
|
-
var ID_PREFIX = "Sortable";
|
|
242
|
-
var Context = /* @__PURE__ */ React.createContext({
|
|
243
|
-
activeIndex: -1,
|
|
244
|
-
containerId: ID_PREFIX,
|
|
245
|
-
disableTransforms: false,
|
|
246
|
-
items: [],
|
|
247
|
-
overIndex: -1,
|
|
248
|
-
useDragOverlay: false,
|
|
249
|
-
sortedRects: [],
|
|
250
|
-
strategy: rectSortingStrategy,
|
|
251
|
-
disabled: {
|
|
252
|
-
draggable: false,
|
|
253
|
-
droppable: false
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
function SortableContext(_ref) {
|
|
257
|
-
let {
|
|
258
|
-
children,
|
|
259
|
-
id,
|
|
260
|
-
items: userDefinedItems,
|
|
261
|
-
strategy = rectSortingStrategy,
|
|
262
|
-
disabled: disabledProp = false
|
|
263
|
-
} = _ref;
|
|
264
|
-
const {
|
|
265
|
-
active,
|
|
266
|
-
dragOverlay,
|
|
267
|
-
droppableRects,
|
|
268
|
-
over,
|
|
269
|
-
measureDroppableContainers
|
|
270
|
-
} = useDndContext();
|
|
271
|
-
const containerId = useUniqueId(ID_PREFIX, id);
|
|
272
|
-
const useDragOverlay = Boolean(dragOverlay.rect !== null);
|
|
273
|
-
const items = useMemo(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
|
|
274
|
-
const isDragging = active != null;
|
|
275
|
-
const activeIndex = active ? items.indexOf(active.id) : -1;
|
|
276
|
-
const overIndex = over ? items.indexOf(over.id) : -1;
|
|
277
|
-
const previousItemsRef = useRef(items);
|
|
278
|
-
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
|
|
279
|
-
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
|
|
280
|
-
const disabled = normalizeDisabled(disabledProp);
|
|
281
|
-
useIsomorphicLayoutEffect(() => {
|
|
282
|
-
if (itemsHaveChanged && isDragging) {
|
|
283
|
-
measureDroppableContainers(items);
|
|
284
|
-
}
|
|
285
|
-
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
|
|
286
|
-
useEffect(() => {
|
|
287
|
-
previousItemsRef.current = items;
|
|
288
|
-
}, [items]);
|
|
289
|
-
const contextValue = useMemo(
|
|
290
|
-
() => ({
|
|
291
|
-
activeIndex,
|
|
292
|
-
containerId,
|
|
293
|
-
disabled,
|
|
294
|
-
disableTransforms,
|
|
295
|
-
items,
|
|
296
|
-
overIndex,
|
|
297
|
-
useDragOverlay,
|
|
298
|
-
sortedRects: getSortedRects(items, droppableRects),
|
|
299
|
-
strategy
|
|
300
|
-
}),
|
|
301
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
302
|
-
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]
|
|
303
|
-
);
|
|
304
|
-
return React.createElement(Context.Provider, {
|
|
305
|
-
value: contextValue
|
|
306
|
-
}, children);
|
|
307
|
-
}
|
|
308
|
-
var defaultNewIndexGetter = (_ref) => {
|
|
309
|
-
let {
|
|
310
|
-
id,
|
|
311
|
-
items,
|
|
312
|
-
activeIndex,
|
|
313
|
-
overIndex
|
|
314
|
-
} = _ref;
|
|
315
|
-
return arrayMove(items, activeIndex, overIndex).indexOf(id);
|
|
316
|
-
};
|
|
317
|
-
var defaultAnimateLayoutChanges = (_ref2) => {
|
|
318
|
-
let {
|
|
319
|
-
containerId,
|
|
320
|
-
isSorting,
|
|
321
|
-
wasDragging,
|
|
322
|
-
index,
|
|
323
|
-
items,
|
|
324
|
-
newIndex,
|
|
325
|
-
previousItems,
|
|
326
|
-
previousContainerId,
|
|
327
|
-
transition
|
|
328
|
-
} = _ref2;
|
|
329
|
-
if (!transition || !wasDragging) {
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
|
-
if (previousItems !== items && index === newIndex) {
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
if (isSorting) {
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
return newIndex !== index && containerId === previousContainerId;
|
|
339
|
-
};
|
|
340
|
-
var defaultTransition = {
|
|
341
|
-
duration: 200,
|
|
342
|
-
easing: "ease"
|
|
343
|
-
};
|
|
344
|
-
var transitionProperty = "transform";
|
|
345
|
-
var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({
|
|
346
|
-
property: transitionProperty,
|
|
347
|
-
duration: 0,
|
|
348
|
-
easing: "linear"
|
|
349
|
-
});
|
|
350
|
-
var defaultAttributes = {
|
|
351
|
-
roleDescription: "sortable"
|
|
352
|
-
};
|
|
353
|
-
function useDerivedTransform(_ref) {
|
|
354
|
-
let {
|
|
355
|
-
disabled,
|
|
356
|
-
index,
|
|
357
|
-
node,
|
|
358
|
-
rect
|
|
359
|
-
} = _ref;
|
|
360
|
-
const [derivedTransform, setDerivedtransform] = useState(null);
|
|
361
|
-
const previousIndex = useRef(index);
|
|
362
|
-
useIsomorphicLayoutEffect(() => {
|
|
363
|
-
if (!disabled && index !== previousIndex.current && node.current) {
|
|
364
|
-
const initial = rect.current;
|
|
365
|
-
if (initial) {
|
|
366
|
-
const current = getClientRect(node.current, {
|
|
367
|
-
ignoreTransform: true
|
|
368
|
-
});
|
|
369
|
-
const delta = {
|
|
370
|
-
x: initial.left - current.left,
|
|
371
|
-
y: initial.top - current.top,
|
|
372
|
-
scaleX: initial.width / current.width,
|
|
373
|
-
scaleY: initial.height / current.height
|
|
374
|
-
};
|
|
375
|
-
if (delta.x || delta.y) {
|
|
376
|
-
setDerivedtransform(delta);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (index !== previousIndex.current) {
|
|
381
|
-
previousIndex.current = index;
|
|
382
|
-
}
|
|
383
|
-
}, [disabled, index, node, rect]);
|
|
384
|
-
useEffect(() => {
|
|
385
|
-
if (derivedTransform) {
|
|
386
|
-
setDerivedtransform(null);
|
|
387
|
-
}
|
|
388
|
-
}, [derivedTransform]);
|
|
389
|
-
return derivedTransform;
|
|
390
|
-
}
|
|
391
|
-
function useSortable(_ref) {
|
|
392
|
-
let {
|
|
393
|
-
animateLayoutChanges = defaultAnimateLayoutChanges,
|
|
394
|
-
attributes: userDefinedAttributes,
|
|
395
|
-
disabled: localDisabled,
|
|
396
|
-
data: customData,
|
|
397
|
-
getNewIndex = defaultNewIndexGetter,
|
|
398
|
-
id,
|
|
399
|
-
strategy: localStrategy,
|
|
400
|
-
resizeObserverConfig,
|
|
401
|
-
transition = defaultTransition
|
|
402
|
-
} = _ref;
|
|
403
|
-
const {
|
|
404
|
-
items,
|
|
405
|
-
containerId,
|
|
406
|
-
activeIndex,
|
|
407
|
-
disabled: globalDisabled,
|
|
408
|
-
disableTransforms,
|
|
409
|
-
sortedRects,
|
|
410
|
-
overIndex,
|
|
411
|
-
useDragOverlay,
|
|
412
|
-
strategy: globalStrategy
|
|
413
|
-
} = useContext(Context);
|
|
414
|
-
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
|
|
415
|
-
const index = items.indexOf(id);
|
|
416
|
-
const data = useMemo(() => ({
|
|
417
|
-
sortable: {
|
|
418
|
-
containerId,
|
|
419
|
-
index,
|
|
420
|
-
items
|
|
421
|
-
},
|
|
422
|
-
...customData
|
|
423
|
-
}), [containerId, customData, index, items]);
|
|
424
|
-
const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);
|
|
425
|
-
const {
|
|
426
|
-
rect,
|
|
427
|
-
node,
|
|
428
|
-
isOver,
|
|
429
|
-
setNodeRef: setDroppableNodeRef
|
|
430
|
-
} = useDroppable({
|
|
431
|
-
id,
|
|
432
|
-
data,
|
|
433
|
-
disabled: disabled.droppable,
|
|
434
|
-
resizeObserverConfig: {
|
|
435
|
-
updateMeasurementsFor: itemsAfterCurrentSortable,
|
|
436
|
-
...resizeObserverConfig
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
const {
|
|
440
|
-
active,
|
|
441
|
-
activatorEvent,
|
|
442
|
-
activeNodeRect,
|
|
443
|
-
attributes,
|
|
444
|
-
setNodeRef: setDraggableNodeRef,
|
|
445
|
-
listeners,
|
|
446
|
-
isDragging,
|
|
447
|
-
over,
|
|
448
|
-
setActivatorNodeRef,
|
|
449
|
-
transform
|
|
450
|
-
} = useDraggable({
|
|
451
|
-
id,
|
|
452
|
-
data,
|
|
453
|
-
attributes: {
|
|
454
|
-
...defaultAttributes,
|
|
455
|
-
...userDefinedAttributes
|
|
456
|
-
},
|
|
457
|
-
disabled: disabled.draggable
|
|
458
|
-
});
|
|
459
|
-
const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
|
|
460
|
-
const isSorting = Boolean(active);
|
|
461
|
-
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
|
|
462
|
-
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
|
|
463
|
-
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
|
|
464
|
-
const strategy = localStrategy != null ? localStrategy : globalStrategy;
|
|
465
|
-
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
|
|
466
|
-
rects: sortedRects,
|
|
467
|
-
activeNodeRect,
|
|
468
|
-
activeIndex,
|
|
469
|
-
overIndex,
|
|
470
|
-
index
|
|
471
|
-
}) : null;
|
|
472
|
-
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
|
|
473
|
-
id,
|
|
474
|
-
items,
|
|
475
|
-
activeIndex,
|
|
476
|
-
overIndex
|
|
477
|
-
}) : index;
|
|
478
|
-
const activeId = active == null ? void 0 : active.id;
|
|
479
|
-
const previous = useRef({
|
|
480
|
-
activeId,
|
|
481
|
-
items,
|
|
482
|
-
newIndex,
|
|
483
|
-
containerId
|
|
484
|
-
});
|
|
485
|
-
const itemsHaveChanged = items !== previous.current.items;
|
|
486
|
-
const shouldAnimateLayoutChanges = animateLayoutChanges({
|
|
487
|
-
active,
|
|
488
|
-
containerId,
|
|
489
|
-
isDragging,
|
|
490
|
-
isSorting,
|
|
491
|
-
id,
|
|
492
|
-
index,
|
|
493
|
-
items,
|
|
494
|
-
newIndex: previous.current.newIndex,
|
|
495
|
-
previousItems: previous.current.items,
|
|
496
|
-
previousContainerId: previous.current.containerId,
|
|
497
|
-
transition,
|
|
498
|
-
wasDragging: previous.current.activeId != null
|
|
499
|
-
});
|
|
500
|
-
const derivedTransform = useDerivedTransform({
|
|
501
|
-
disabled: !shouldAnimateLayoutChanges,
|
|
502
|
-
index,
|
|
503
|
-
node,
|
|
504
|
-
rect
|
|
505
|
-
});
|
|
506
|
-
useEffect(() => {
|
|
507
|
-
if (isSorting && previous.current.newIndex !== newIndex) {
|
|
508
|
-
previous.current.newIndex = newIndex;
|
|
509
|
-
}
|
|
510
|
-
if (containerId !== previous.current.containerId) {
|
|
511
|
-
previous.current.containerId = containerId;
|
|
512
|
-
}
|
|
513
|
-
if (items !== previous.current.items) {
|
|
514
|
-
previous.current.items = items;
|
|
515
|
-
}
|
|
516
|
-
}, [isSorting, newIndex, containerId, items]);
|
|
517
|
-
useEffect(() => {
|
|
518
|
-
if (activeId === previous.current.activeId) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
if (activeId != null && previous.current.activeId == null) {
|
|
522
|
-
previous.current.activeId = activeId;
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
const timeoutId = setTimeout(() => {
|
|
526
|
-
previous.current.activeId = activeId;
|
|
527
|
-
}, 50);
|
|
528
|
-
return () => clearTimeout(timeoutId);
|
|
529
|
-
}, [activeId]);
|
|
530
|
-
return {
|
|
531
|
-
active,
|
|
532
|
-
activeIndex,
|
|
533
|
-
attributes,
|
|
534
|
-
data,
|
|
535
|
-
rect,
|
|
536
|
-
index,
|
|
537
|
-
newIndex,
|
|
538
|
-
items,
|
|
539
|
-
isOver,
|
|
540
|
-
isSorting,
|
|
541
|
-
isDragging,
|
|
542
|
-
listeners,
|
|
543
|
-
node,
|
|
544
|
-
overIndex,
|
|
545
|
-
over,
|
|
546
|
-
setNodeRef,
|
|
547
|
-
setActivatorNodeRef,
|
|
548
|
-
setDroppableNodeRef,
|
|
549
|
-
setDraggableNodeRef,
|
|
550
|
-
transform: derivedTransform != null ? derivedTransform : finalTransform,
|
|
551
|
-
transition: getTransition()
|
|
552
|
-
};
|
|
553
|
-
function getTransition() {
|
|
554
|
-
if (
|
|
555
|
-
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
556
|
-
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
|
|
557
|
-
itemsHaveChanged && previous.current.newIndex === index
|
|
558
|
-
) {
|
|
559
|
-
return disabledTransition;
|
|
560
|
-
}
|
|
561
|
-
if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {
|
|
562
|
-
return void 0;
|
|
563
|
-
}
|
|
564
|
-
if (isSorting || shouldAnimateLayoutChanges) {
|
|
565
|
-
return CSS.Transition.toString({
|
|
566
|
-
...transition,
|
|
567
|
-
property: transitionProperty
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
return void 0;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
function normalizeLocalDisabled(localDisabled, globalDisabled) {
|
|
574
|
-
var _localDisabled$dragga, _localDisabled$droppa;
|
|
575
|
-
if (typeof localDisabled === "boolean") {
|
|
576
|
-
return {
|
|
577
|
-
draggable: localDisabled,
|
|
578
|
-
// Backwards compatibility
|
|
579
|
-
droppable: false
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
return {
|
|
583
|
-
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
|
|
584
|
-
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
function hasSortableData(entry) {
|
|
588
|
-
if (!entry) {
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
const data = entry.data.current;
|
|
592
|
-
if (data && "sortable" in data && typeof data.sortable === "object" && "containerId" in data.sortable && "items" in data.sortable && "index" in data.sortable) {
|
|
593
|
-
return true;
|
|
594
|
-
}
|
|
595
|
-
return false;
|
|
596
|
-
}
|
|
597
|
-
var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
|
|
598
|
-
var sortableKeyboardCoordinates = (event, _ref) => {
|
|
599
|
-
let {
|
|
600
|
-
context: {
|
|
601
|
-
active,
|
|
602
|
-
collisionRect,
|
|
603
|
-
droppableRects,
|
|
604
|
-
droppableContainers,
|
|
605
|
-
over,
|
|
606
|
-
scrollableAncestors
|
|
607
|
-
}
|
|
608
|
-
} = _ref;
|
|
609
|
-
if (directions.includes(event.code)) {
|
|
610
|
-
event.preventDefault();
|
|
611
|
-
if (!active || !collisionRect) {
|
|
612
|
-
return;
|
|
613
|
-
}
|
|
614
|
-
const filteredContainers = [];
|
|
615
|
-
droppableContainers.getEnabled().forEach((entry) => {
|
|
616
|
-
if (!entry || entry != null && entry.disabled) {
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
const rect = droppableRects.get(entry.id);
|
|
620
|
-
if (!rect) {
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
switch (event.code) {
|
|
624
|
-
case KeyboardCode.Down:
|
|
625
|
-
if (collisionRect.top < rect.top) {
|
|
626
|
-
filteredContainers.push(entry);
|
|
627
|
-
}
|
|
628
|
-
break;
|
|
629
|
-
case KeyboardCode.Up:
|
|
630
|
-
if (collisionRect.top > rect.top) {
|
|
631
|
-
filteredContainers.push(entry);
|
|
632
|
-
}
|
|
633
|
-
break;
|
|
634
|
-
case KeyboardCode.Left:
|
|
635
|
-
if (collisionRect.left > rect.left) {
|
|
636
|
-
filteredContainers.push(entry);
|
|
637
|
-
}
|
|
638
|
-
break;
|
|
639
|
-
case KeyboardCode.Right:
|
|
640
|
-
if (collisionRect.left < rect.left) {
|
|
641
|
-
filteredContainers.push(entry);
|
|
642
|
-
}
|
|
643
|
-
break;
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
const collisions = closestCorners({
|
|
647
|
-
active,
|
|
648
|
-
collisionRect,
|
|
649
|
-
droppableRects,
|
|
650
|
-
droppableContainers: filteredContainers,
|
|
651
|
-
pointerCoordinates: null
|
|
652
|
-
});
|
|
653
|
-
let closestId = getFirstCollision(collisions, "id");
|
|
654
|
-
if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
|
|
655
|
-
closestId = collisions[1].id;
|
|
656
|
-
}
|
|
657
|
-
if (closestId != null) {
|
|
658
|
-
const activeDroppable = droppableContainers.get(active.id);
|
|
659
|
-
const newDroppable = droppableContainers.get(closestId);
|
|
660
|
-
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
|
|
661
|
-
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
|
|
662
|
-
if (newNode && newRect && activeDroppable && newDroppable) {
|
|
663
|
-
const newScrollAncestors = getScrollableAncestors(newNode);
|
|
664
|
-
const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
|
|
665
|
-
const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
|
|
666
|
-
const isAfterActive = isAfter(activeDroppable, newDroppable);
|
|
667
|
-
const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
|
|
668
|
-
x: 0,
|
|
669
|
-
y: 0
|
|
670
|
-
} : {
|
|
671
|
-
x: isAfterActive ? collisionRect.width - newRect.width : 0,
|
|
672
|
-
y: isAfterActive ? collisionRect.height - newRect.height : 0
|
|
673
|
-
};
|
|
674
|
-
const rectCoordinates = {
|
|
675
|
-
x: newRect.left,
|
|
676
|
-
y: newRect.top
|
|
677
|
-
};
|
|
678
|
-
const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);
|
|
679
|
-
return newCoordinates;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
return void 0;
|
|
684
|
-
};
|
|
685
|
-
function isSameContainer(a, b) {
|
|
686
|
-
if (!hasSortableData(a) || !hasSortableData(b)) {
|
|
687
|
-
return false;
|
|
688
|
-
}
|
|
689
|
-
return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
|
|
690
|
-
}
|
|
691
|
-
function isAfter(a, b) {
|
|
692
|
-
if (!hasSortableData(a) || !hasSortableData(b)) {
|
|
693
|
-
return false;
|
|
694
|
-
}
|
|
695
|
-
if (!isSameContainer(a, b)) {
|
|
696
|
-
return false;
|
|
697
|
-
}
|
|
698
|
-
return a.data.current.sortable.index < b.data.current.sortable.index;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
// shell/.ojm-shim-dnd-kit-sortable.mjs
|
|
702
|
-
var ojm_shim_dnd_kit_sortable_default = void 0 ?? sortable_esm_exports;
|
|
703
|
-
export {
|
|
704
|
-
SortableContext,
|
|
705
|
-
arrayMove,
|
|
706
|
-
arraySwap,
|
|
707
|
-
ojm_shim_dnd_kit_sortable_default as default,
|
|
708
|
-
defaultAnimateLayoutChanges,
|
|
709
|
-
defaultNewIndexGetter,
|
|
710
|
-
hasSortableData,
|
|
711
|
-
horizontalListSortingStrategy,
|
|
712
|
-
rectSortingStrategy,
|
|
713
|
-
rectSwappingStrategy,
|
|
714
|
-
sortableKeyboardCoordinates,
|
|
715
|
-
useSortable,
|
|
716
|
-
verticalListSortingStrategy
|
|
717
|
-
};
|