@bylqwjc/media-editor-react 1.0.12
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/index.cjs +282 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/filerobot.css +1669 -0
- package/node_modules/@media-editor/client/LICENSE +21 -0
- package/node_modules/@media-editor/client/README.md +27 -0
- package/node_modules/@media-editor/client/dist/index.cjs +60 -0
- package/node_modules/@media-editor/client/dist/index.cjs.map +1 -0
- package/node_modules/@media-editor/client/dist/index.d.cts +24 -0
- package/node_modules/@media-editor/client/dist/index.d.ts +24 -0
- package/node_modules/@media-editor/client/dist/index.js +35 -0
- package/node_modules/@media-editor/client/dist/index.js.map +1 -0
- package/node_modules/@media-editor/client/package.json +23 -0
- package/node_modules/@media-editor/core/LICENSE +21 -0
- package/node_modules/@media-editor/core/README.md +14 -0
- package/node_modules/@media-editor/core/dist/browser.cjs +505 -0
- package/node_modules/@media-editor/core/dist/browser.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/browser.d.cts +100 -0
- package/node_modules/@media-editor/core/dist/browser.d.ts +100 -0
- package/node_modules/@media-editor/core/dist/browser.js +883 -0
- package/node_modules/@media-editor/core/dist/browser.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js +371 -0
- package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js +87 -0
- package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js.map +1 -0
- package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js +592 -0
- package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js.map +1 -0
- package/node_modules/@media-editor/core/dist/engine.cjs +540 -0
- package/node_modules/@media-editor/core/dist/engine.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/engine.d.cts +325 -0
- package/node_modules/@media-editor/core/dist/engine.d.ts +359 -0
- package/node_modules/@media-editor/core/dist/engine.js +315 -0
- package/node_modules/@media-editor/core/dist/engine.js.map +1 -0
- package/node_modules/@media-editor/core/dist/filerobot.cjs +818 -0
- package/node_modules/@media-editor/core/dist/filerobot.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/filerobot.d.cts +88 -0
- package/node_modules/@media-editor/core/dist/filerobot.d.ts +88 -0
- package/node_modules/@media-editor/core/dist/filerobot.js +473 -0
- package/node_modules/@media-editor/core/dist/filerobot.js.map +1 -0
- package/node_modules/@media-editor/core/dist/index.cjs +1276 -0
- package/node_modules/@media-editor/core/dist/index.cjs.map +1 -0
- package/node_modules/@media-editor/core/dist/index.d.cts +242 -0
- package/node_modules/@media-editor/core/dist/index.d.ts +264 -0
- package/node_modules/@media-editor/core/dist/index.js +682 -0
- package/node_modules/@media-editor/core/dist/index.js.map +1 -0
- package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.cts +80 -0
- package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.ts +80 -0
- package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.cts +936 -0
- package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.ts +1027 -0
- package/node_modules/@media-editor/core/node_modules/zod/LICENSE +21 -0
- package/node_modules/@media-editor/core/node_modules/zod/README.md +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/package.json +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/index.js +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v4-mini/index.js +1 -0
- package/node_modules/@media-editor/core/package.json +42 -0
- package/node_modules/@media-editor/image/LICENSE +21 -0
- package/node_modules/@media-editor/image/README.md +48 -0
- package/node_modules/@media-editor/image/dist/chunk-5TBO732O.js +1 -0
- package/node_modules/@media-editor/image/dist/index-CU3vkvDR.d.ts +44 -0
- package/node_modules/@media-editor/image/dist/index.css +1 -0
- package/node_modules/@media-editor/image/dist/index.d.ts +2 -0
- package/node_modules/@media-editor/image/dist/index.js +364 -0
- package/node_modules/@media-editor/image/dist/lazy.css +1 -0
- package/node_modules/@media-editor/image/dist/lazy.d.ts +8 -0
- package/node_modules/@media-editor/image/dist/lazy.js +1 -0
- package/node_modules/@media-editor/image/package.json +29 -0
- package/node_modules/@media-editor/video/LICENSE +21 -0
- package/node_modules/@media-editor/video/README.md +55 -0
- package/node_modules/@media-editor/video/dist/chunk-EK7ODJWE.js +1 -0
- package/node_modules/@media-editor/video/dist/index-CX2iAapm.d.ts +51 -0
- package/node_modules/@media-editor/video/dist/index.d.ts +4 -0
- package/node_modules/@media-editor/video/dist/index.js +16919 -0
- package/node_modules/@media-editor/video/dist/lazy.d.ts +10 -0
- package/node_modules/@media-editor/video/dist/lazy.js +1 -0
- package/node_modules/@media-editor/video/dist/legacy.js +65 -0
- package/node_modules/@media-editor/video/package.json +29 -0
- package/package.json +48 -0
- package/style.css +1 -0
- package/theme.css +1214 -0
|
@@ -0,0 +1,1276 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
// src/state.ts
|
|
6
|
+
var StrokeCommon = {
|
|
7
|
+
color: zod.z.string().max(32),
|
|
8
|
+
width: zod.z.number().positive().max(200)
|
|
9
|
+
};
|
|
10
|
+
var RotationCommon = {
|
|
11
|
+
rotation: zod.z.number().min(-180).max(180).optional()
|
|
12
|
+
};
|
|
13
|
+
var Overlay = zod.z.discriminatedUnion("type", [
|
|
14
|
+
// 自由画笔:扁平点序列 [x0,y0,x1,y1,...]
|
|
15
|
+
zod.z.object({ type: zod.z.literal("pen"), points: zod.z.array(zod.z.number()).min(4), ...StrokeCommon, ...RotationCommon }),
|
|
16
|
+
zod.z.object({ type: zod.z.literal("line"), x1: zod.z.number(), y1: zod.z.number(), x2: zod.z.number(), y2: zod.z.number(), ...StrokeCommon, ...RotationCommon }),
|
|
17
|
+
zod.z.object({ type: zod.z.literal("arrow"), x1: zod.z.number(), y1: zod.z.number(), x2: zod.z.number(), y2: zod.z.number(), ...StrokeCommon, ...RotationCommon }),
|
|
18
|
+
zod.z.object({ type: zod.z.literal("rect"), x: zod.z.number(), y: zod.z.number(), w: zod.z.number(), h: zod.z.number(), ...StrokeCommon, ...RotationCommon }),
|
|
19
|
+
zod.z.object({ type: zod.z.literal("ellipse"), x: zod.z.number(), y: zod.z.number(), w: zod.z.number(), h: zod.z.number(), ...StrokeCommon, ...RotationCommon }),
|
|
20
|
+
zod.z.object({
|
|
21
|
+
type: zod.z.literal("text"),
|
|
22
|
+
x: zod.z.number(),
|
|
23
|
+
y: zod.z.number(),
|
|
24
|
+
text: zod.z.string().max(500),
|
|
25
|
+
color: zod.z.string().max(32),
|
|
26
|
+
fontSize: zod.z.number().positive().max(512),
|
|
27
|
+
...RotationCommon
|
|
28
|
+
}),
|
|
29
|
+
// emoji 字符 或 dataURL 图片二选一
|
|
30
|
+
zod.z.object({
|
|
31
|
+
type: zod.z.literal("sticker"),
|
|
32
|
+
x: zod.z.number(),
|
|
33
|
+
y: zod.z.number(),
|
|
34
|
+
w: zod.z.number().positive(),
|
|
35
|
+
h: zod.z.number().positive(),
|
|
36
|
+
emoji: zod.z.string().max(16).optional(),
|
|
37
|
+
src: zod.z.string().optional(),
|
|
38
|
+
...RotationCommon
|
|
39
|
+
})
|
|
40
|
+
]);
|
|
41
|
+
var Clip = zod.z.object({
|
|
42
|
+
srcIdx: zod.z.number().int().min(0).max(7),
|
|
43
|
+
in: zod.z.number().min(0),
|
|
44
|
+
out: zod.z.number().min(0)
|
|
45
|
+
});
|
|
46
|
+
var AudioClip = zod.z.object({
|
|
47
|
+
srcIdx: zod.z.number().int().min(0).max(2),
|
|
48
|
+
startAt: zod.z.number().min(0),
|
|
49
|
+
in: zod.z.number().min(0),
|
|
50
|
+
out: zod.z.number().min(0),
|
|
51
|
+
volume: zod.z.number().min(0).max(2)
|
|
52
|
+
});
|
|
53
|
+
var Transition = zod.z.object({
|
|
54
|
+
type: zod.z.enum(["none", "fade", "slide", "wipe", "flip", "clockWipe", "star", "circle", "rectangle"]).default("none"),
|
|
55
|
+
duration: zod.z.number().min(0).max(2).default(0.4)
|
|
56
|
+
});
|
|
57
|
+
var VideoEditState = zod.z.object({
|
|
58
|
+
clips: zod.z.array(Clip).min(1).max(50),
|
|
59
|
+
audioClips: zod.z.array(AudioClip).max(8).default([]),
|
|
60
|
+
/** 输出画布(=首素材分辨率,偶数);全局 crop/rotation 的"源 dims" */
|
|
61
|
+
canvas: zod.z.object({
|
|
62
|
+
w: zod.z.number().int().min(2).max(4096),
|
|
63
|
+
h: zod.z.number().int().min(2).max(4096)
|
|
64
|
+
}),
|
|
65
|
+
crop: zod.z.object({
|
|
66
|
+
x: zod.z.number().min(0),
|
|
67
|
+
y: zod.z.number().min(0),
|
|
68
|
+
width: zod.z.number().positive(),
|
|
69
|
+
height: zod.z.number().positive()
|
|
70
|
+
}).optional(),
|
|
71
|
+
scale: zod.z.object({
|
|
72
|
+
width: zod.z.number().positive(),
|
|
73
|
+
height: zod.z.number().positive(),
|
|
74
|
+
fit: zod.z.enum(["contain", "cover", "force"])
|
|
75
|
+
}).optional(),
|
|
76
|
+
/** 任意角度(度)。UI = 90° 步进按钮 + ±45° 刻度盘叠加 */
|
|
77
|
+
rotation: zod.z.number().min(-180).max(180).default(0),
|
|
78
|
+
flipX: zod.z.boolean().default(false),
|
|
79
|
+
flipY: zod.z.boolean().default(false),
|
|
80
|
+
filters: zod.z.object({
|
|
81
|
+
brightness: zod.z.number().min(-1).max(1),
|
|
82
|
+
contrast: zod.z.number().min(-1).max(1),
|
|
83
|
+
saturation: zod.z.number().min(-1).max(1),
|
|
84
|
+
gamma: zod.z.number().min(-1).max(1).default(0)
|
|
85
|
+
}).default({ brightness: 0, contrast: 0, saturation: 0, gamma: 0 }),
|
|
86
|
+
/** 预设滤镜 id(见 filters.ts);与 filters 手调叠加 */
|
|
87
|
+
filterPreset: zod.z.string().max(32).optional(),
|
|
88
|
+
overlays: zod.z.array(Overlay).max(200).optional(),
|
|
89
|
+
transitions: zod.z.array(Transition).max(49).default([]),
|
|
90
|
+
/** 原视频声音开关(与音乐混音共存) */
|
|
91
|
+
keepAudio: zod.z.boolean().default(true),
|
|
92
|
+
/** 封面时刻 = 输出时间轴 */
|
|
93
|
+
poster: zod.z.object({ time: zod.z.number().min(0) }).optional()
|
|
94
|
+
}).superRefine((s, ctx) => {
|
|
95
|
+
s.clips.forEach((c, i) => {
|
|
96
|
+
if (c.out <= c.in) {
|
|
97
|
+
ctx.addIssue({ code: zod.z.ZodIssueCode.custom, message: `clips[${i}].out \u5FC5\u987B\u5927\u4E8E in`, path: ["clips", i, "out"] });
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
s.audioClips?.forEach((a, i) => {
|
|
101
|
+
if (a.out <= a.in) {
|
|
102
|
+
ctx.addIssue({ code: zod.z.ZodIssueCode.custom, message: `audioClips[${i}].out \u5FC5\u987B\u5927\u4E8E in`, path: ["audioClips", i, "out"] });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (s.canvas.w % 2 !== 0 || s.canvas.h % 2 !== 0) {
|
|
106
|
+
ctx.addIssue({ code: zod.z.ZodIssueCode.custom, message: "canvas \u5BBD\u9AD8\u5FC5\u987B\u4E3A\u5076\u6570", path: ["canvas"] });
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
function defaultVideoEditState() {
|
|
110
|
+
return {
|
|
111
|
+
clips: [],
|
|
112
|
+
audioClips: [],
|
|
113
|
+
canvas: { w: 2, h: 2 },
|
|
114
|
+
rotation: 0,
|
|
115
|
+
flipX: false,
|
|
116
|
+
flipY: false,
|
|
117
|
+
filters: { brightness: 0, contrast: 0, saturation: 0, gamma: 0 },
|
|
118
|
+
transitions: [],
|
|
119
|
+
keepAudio: true
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/timeline.ts
|
|
124
|
+
var MIN_CLIP = 0.1;
|
|
125
|
+
function clipDuration(c) {
|
|
126
|
+
return c.out - c.in;
|
|
127
|
+
}
|
|
128
|
+
function totalDuration(clips) {
|
|
129
|
+
return clips.reduce((s, c) => s + clipDuration(c), 0);
|
|
130
|
+
}
|
|
131
|
+
function clipStartsAt(clips, idx) {
|
|
132
|
+
let s = 0;
|
|
133
|
+
for (let i = 0; i < idx && i < clips.length; i++) s += clipDuration(clips[i]);
|
|
134
|
+
return s;
|
|
135
|
+
}
|
|
136
|
+
function locateOutput(clips, t) {
|
|
137
|
+
if (!clips.length || t < 0) return null;
|
|
138
|
+
let acc = 0;
|
|
139
|
+
for (let i = 0; i < clips.length; i++) {
|
|
140
|
+
const d = clipDuration(clips[i]);
|
|
141
|
+
if (t < acc + d) return { idx: i, srcTime: clips[i].in + (t - acc) };
|
|
142
|
+
acc += d;
|
|
143
|
+
}
|
|
144
|
+
if (Math.abs(t - acc) < 1e-9 || t <= acc) {
|
|
145
|
+
const last = clips.length - 1;
|
|
146
|
+
return { idx: last, srcTime: clips[last].out };
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
function splitAtOutput(clips, t) {
|
|
151
|
+
const loc = locateOutput(clips, t);
|
|
152
|
+
if (!loc) return clips;
|
|
153
|
+
const c = clips[loc.idx];
|
|
154
|
+
if (loc.srcTime < c.in + MIN_CLIP || loc.srcTime > c.out - MIN_CLIP) return clips;
|
|
155
|
+
return [
|
|
156
|
+
...clips.slice(0, loc.idx),
|
|
157
|
+
{ ...c, out: loc.srcTime },
|
|
158
|
+
{ ...c, in: loc.srcTime },
|
|
159
|
+
...clips.slice(loc.idx + 1)
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
function removeClip(clips, idx) {
|
|
163
|
+
if (clips.length <= 1 || !clips[idx]) return clips;
|
|
164
|
+
return clips.filter((_, i) => i !== idx);
|
|
165
|
+
}
|
|
166
|
+
function duplicateClip(clips, idx) {
|
|
167
|
+
const c = clips[idx];
|
|
168
|
+
if (!c) return clips;
|
|
169
|
+
return [...clips.slice(0, idx + 1), { ...c }, ...clips.slice(idx + 1)];
|
|
170
|
+
}
|
|
171
|
+
function reorderClips(clips, from, to) {
|
|
172
|
+
if (from === to || !clips[from] || to < 0 || to >= clips.length) return clips;
|
|
173
|
+
const next = [...clips];
|
|
174
|
+
const [moved] = next.splice(from, 1);
|
|
175
|
+
next.splice(to, 0, moved);
|
|
176
|
+
return next;
|
|
177
|
+
}
|
|
178
|
+
function trimClipEdge(clips, idx, edge, srcT, srcDuration) {
|
|
179
|
+
const c = clips[idx];
|
|
180
|
+
if (!c) return clips;
|
|
181
|
+
const next = clips.map((x) => ({ ...x }));
|
|
182
|
+
if (edge === "in") {
|
|
183
|
+
next[idx].in = Math.min(Math.max(srcT, 0), next[idx].out - MIN_CLIP);
|
|
184
|
+
} else {
|
|
185
|
+
next[idx].out = Math.max(Math.min(srcT, srcDuration), next[idx].in + MIN_CLIP);
|
|
186
|
+
}
|
|
187
|
+
return next;
|
|
188
|
+
}
|
|
189
|
+
function clampAudioClip(a, srcDuration, total) {
|
|
190
|
+
const out = Math.max(Math.min(a.out, srcDuration), MIN_CLIP);
|
|
191
|
+
const inn = Math.min(Math.max(a.in, 0), out - MIN_CLIP);
|
|
192
|
+
const startAt = Math.min(Math.max(a.startAt, 0), Math.max(0, total - MIN_CLIP));
|
|
193
|
+
return { ...a, in: inn, out, startAt };
|
|
194
|
+
}
|
|
195
|
+
function contentDuration(clips, audioClips = []) {
|
|
196
|
+
const video = totalDuration(clips);
|
|
197
|
+
const audioEnd = audioClips.reduce((m, a) => Math.max(m, a.startAt + (a.out - a.in)), 0);
|
|
198
|
+
return Math.max(video, audioEnd);
|
|
199
|
+
}
|
|
200
|
+
function usedVideoSrcIndices(clips) {
|
|
201
|
+
return [...new Set(clips.map((c) => c.srcIdx))].sort((x, y) => x - y);
|
|
202
|
+
}
|
|
203
|
+
function remapSrcIndices(clips, used) {
|
|
204
|
+
const map = new Map(used.map((s, i) => [s, i]));
|
|
205
|
+
return clips.map((c) => ({ ...c, srcIdx: map.get(c.srcIdx) ?? 0 }));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/transform.ts
|
|
209
|
+
var DEG2RAD = Math.PI / 180;
|
|
210
|
+
function rotatedSize(w, h, deg) {
|
|
211
|
+
const norm = normalizeDeg(deg);
|
|
212
|
+
if (norm === 0 || norm === 180) return { w, h };
|
|
213
|
+
if (norm === 90 || norm === 270) return { w: h, h: w };
|
|
214
|
+
const rad = norm * DEG2RAD;
|
|
215
|
+
return {
|
|
216
|
+
w: Math.round(Math.abs(w * Math.cos(rad)) + Math.abs(h * Math.sin(rad))),
|
|
217
|
+
h: Math.round(Math.abs(w * Math.sin(rad)) + Math.abs(h * Math.cos(rad)))
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function normalizeDeg(deg) {
|
|
221
|
+
return (deg % 360 + 360) % 360;
|
|
222
|
+
}
|
|
223
|
+
function evenize(n) {
|
|
224
|
+
const v = Math.round(n);
|
|
225
|
+
return v - v % 2;
|
|
226
|
+
}
|
|
227
|
+
function clampRect(rect, bounds, minSize = 40) {
|
|
228
|
+
const width = Math.min(Math.max(minSize, rect.width), bounds.w);
|
|
229
|
+
const height = Math.min(Math.max(minSize, rect.height), bounds.h);
|
|
230
|
+
const x = Math.min(Math.max(0, rect.x), bounds.w - width);
|
|
231
|
+
const y = Math.min(Math.max(0, rect.y), bounds.h - height);
|
|
232
|
+
return { x: Math.round(x), y: Math.round(y), width: Math.round(width), height: Math.round(height) };
|
|
233
|
+
}
|
|
234
|
+
function centeredMaxRect(bounds, aspect) {
|
|
235
|
+
let width = bounds.w;
|
|
236
|
+
let height = width / aspect;
|
|
237
|
+
if (height > bounds.h) {
|
|
238
|
+
height = bounds.h;
|
|
239
|
+
width = height * aspect;
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
x: Math.round((bounds.w - width) / 2),
|
|
243
|
+
y: Math.round((bounds.h - height) / 2),
|
|
244
|
+
width: Math.round(width),
|
|
245
|
+
height: Math.round(height)
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function fitRects(crop, out, fit) {
|
|
249
|
+
const fullSrc = { x: 0, y: 0, width: crop.width, height: crop.height };
|
|
250
|
+
const fullDst = { x: 0, y: 0, width: out.w, height: out.h };
|
|
251
|
+
if (fit === "cover") {
|
|
252
|
+
return { src: centeredMaxRect({ w: crop.width, h: crop.height }, out.w / out.h), dst: fullDst };
|
|
253
|
+
}
|
|
254
|
+
if (fit === "contain") {
|
|
255
|
+
return { src: fullSrc, dst: centeredMaxRect({ w: out.w, h: out.h }, crop.width / crop.height) };
|
|
256
|
+
}
|
|
257
|
+
return { src: fullSrc, dst: fullDst };
|
|
258
|
+
}
|
|
259
|
+
function outputSize(source, state) {
|
|
260
|
+
if (state.scale) return { w: evenize(state.scale.width), h: evenize(state.scale.height) };
|
|
261
|
+
if (state.crop) return { w: evenize(state.crop.width), h: evenize(state.crop.height) };
|
|
262
|
+
const r = rotatedSize(source.w, source.h, state.rotation);
|
|
263
|
+
return { w: evenize(r.w), h: evenize(r.h) };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// src/filters.ts
|
|
267
|
+
var FILTER_PRESETS = [
|
|
268
|
+
{ id: "bw", label: "\u9ED1\u767D", vf: "hue=s=0", css: "grayscale(1)" },
|
|
269
|
+
{
|
|
270
|
+
id: "sepia",
|
|
271
|
+
label: "\u590D\u53E4",
|
|
272
|
+
vf: "colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131",
|
|
273
|
+
css: "sepia(0.85)"
|
|
274
|
+
},
|
|
275
|
+
{ id: "warm", label: "\u6696\u9633", vf: "colorbalance=rs=.15:gs=.04:bs=-.15", css: "sepia(0.25) saturate(1.25) brightness(1.03)" },
|
|
276
|
+
{ id: "cool", label: "\u51B7\u8C03", vf: "colorbalance=rs=-.14:bs=.16", css: "hue-rotate(12deg) saturate(0.95) brightness(1.02)" },
|
|
277
|
+
{ id: "vivid", label: "\u9C9C\u8273", vf: "eq=saturation=1.45:contrast=1.08", css: "saturate(1.45) contrast(1.08)" }
|
|
278
|
+
];
|
|
279
|
+
function findFilterPreset(id) {
|
|
280
|
+
return id ? FILTER_PRESETS.find((p) => p.id === id) : void 0;
|
|
281
|
+
}
|
|
282
|
+
function buildFilterCss(filters, presetId) {
|
|
283
|
+
const presetCss = findFilterPreset(presetId)?.css ?? "";
|
|
284
|
+
return [
|
|
285
|
+
`brightness(${1 + filters.brightness})`,
|
|
286
|
+
`contrast(${1 + filters.contrast})`,
|
|
287
|
+
`saturate(${1 + filters.saturation})`,
|
|
288
|
+
presetCss
|
|
289
|
+
].filter(Boolean).join(" ");
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/ffmpeg-args.ts
|
|
293
|
+
function rotationFilters(deg) {
|
|
294
|
+
const norm = normalizeDeg(deg);
|
|
295
|
+
if (norm === 0) return [];
|
|
296
|
+
if (norm === 90) return ["transpose=1"];
|
|
297
|
+
if (norm === 180) return ["transpose=1", "transpose=1"];
|
|
298
|
+
if (norm === 270) return ["transpose=2"];
|
|
299
|
+
const rad = `${norm}*PI/180`;
|
|
300
|
+
return [`rotate=${rad}:ow=rotw(${rad}):oh=roth(${rad}):c=black`];
|
|
301
|
+
}
|
|
302
|
+
function eqFilter(f) {
|
|
303
|
+
const { brightness, contrast, saturation } = f;
|
|
304
|
+
const gamma = f.gamma ?? 0;
|
|
305
|
+
if (brightness === 0 && contrast === 0 && saturation === 0 && gamma === 0) return null;
|
|
306
|
+
const parts = [];
|
|
307
|
+
if (brightness !== 0) parts.push(`brightness=${brightness}`);
|
|
308
|
+
if (contrast !== 0) parts.push(`contrast=${1 + contrast}`);
|
|
309
|
+
if (saturation !== 0) parts.push(`saturation=${1 + saturation}`);
|
|
310
|
+
if (gamma !== 0) parts.push(`gamma=${(1 + gamma * (gamma > 0 ? 1 : 0.5)).toFixed(3)}`);
|
|
311
|
+
return `eq=${parts.join(":")}`;
|
|
312
|
+
}
|
|
313
|
+
function buildVideoFilters(state) {
|
|
314
|
+
const vf = [];
|
|
315
|
+
if (state.flipX) vf.push("hflip");
|
|
316
|
+
if (state.flipY) vf.push("vflip");
|
|
317
|
+
vf.push(...rotationFilters(state.rotation));
|
|
318
|
+
if (state.crop) {
|
|
319
|
+
const { x, y, width, height } = state.crop;
|
|
320
|
+
vf.push(`crop=${width}:${height}:${x}:${y}`);
|
|
321
|
+
}
|
|
322
|
+
if (state.scale) {
|
|
323
|
+
const { width, height, fit } = state.scale;
|
|
324
|
+
if (fit === "force") {
|
|
325
|
+
vf.push(`scale=${width}:${height}`);
|
|
326
|
+
} else if (fit === "cover") {
|
|
327
|
+
vf.push(`scale=${width}:${height}:force_original_aspect_ratio=increase`, `crop=${width}:${height}`);
|
|
328
|
+
} else {
|
|
329
|
+
vf.push(
|
|
330
|
+
`scale=${width}:${height}:force_original_aspect_ratio=decrease`,
|
|
331
|
+
`pad=${width}:${height}:(ow-iw)/2:(oh-ih)/2`
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const eq = eqFilter(state.filters);
|
|
336
|
+
if (eq) vf.push(eq);
|
|
337
|
+
const preset = findFilterPreset(state.filterPreset);
|
|
338
|
+
if (preset) vf.push(preset.vf);
|
|
339
|
+
const norm = normalizeDeg(state.rotation);
|
|
340
|
+
if (norm % 90 !== 0 && !state.scale) {
|
|
341
|
+
vf.push("scale=trunc(iw/2)*2:trunc(ih/2)*2");
|
|
342
|
+
}
|
|
343
|
+
return vf;
|
|
344
|
+
}
|
|
345
|
+
var TRANSITION_FFMPEG_MAP = {
|
|
346
|
+
fade: "fade",
|
|
347
|
+
slide: "slideleft",
|
|
348
|
+
wipe: "wipeleft",
|
|
349
|
+
flip: "horzopen",
|
|
350
|
+
clockWipe: "radial",
|
|
351
|
+
star: "pixelize",
|
|
352
|
+
circle: "circleopen",
|
|
353
|
+
rectangle: "rectcrop"
|
|
354
|
+
};
|
|
355
|
+
var TRANSITION_AUDIO_CURVE_MAP = {
|
|
356
|
+
fade: "qsin",
|
|
357
|
+
slide: "tri",
|
|
358
|
+
wipe: "tri",
|
|
359
|
+
flip: "exp",
|
|
360
|
+
clockWipe: "qsin",
|
|
361
|
+
star: "tri",
|
|
362
|
+
circle: "qsin",
|
|
363
|
+
rectangle: "qsin"
|
|
364
|
+
};
|
|
365
|
+
function clipSpanDuration(clip) {
|
|
366
|
+
return clip.out - clip.in;
|
|
367
|
+
}
|
|
368
|
+
function resolveTransition(transition, leftDuration, rightDuration) {
|
|
369
|
+
const type = transition && typeof transition.type === "string" ? transition.type : "none";
|
|
370
|
+
const mapped = TRANSITION_FFMPEG_MAP[type] ? type : "none";
|
|
371
|
+
const maxDuration = Math.max(0, Math.min(1.2, leftDuration - 0.05, rightDuration - 0.05));
|
|
372
|
+
if (mapped === "none" || maxDuration <= 0.05) {
|
|
373
|
+
return { type: "none", duration: 0, effect: "fade", curve: "tri" };
|
|
374
|
+
}
|
|
375
|
+
const rawDuration = Number(transition?.duration);
|
|
376
|
+
const duration = Math.min(Math.max(Number.isFinite(rawDuration) ? rawDuration : 0.4, 0.1), maxDuration);
|
|
377
|
+
return {
|
|
378
|
+
type: mapped,
|
|
379
|
+
duration,
|
|
380
|
+
effect: TRANSITION_FFMPEG_MAP[mapped],
|
|
381
|
+
curve: TRANSITION_AUDIO_CURVE_MAP[mapped] ?? "tri"
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function hasActiveTransitions(transitions, clips) {
|
|
385
|
+
if (!Array.isArray(clips) || clips.length < 2) return false;
|
|
386
|
+
for (let i = 0; i < clips.length - 1; i++) {
|
|
387
|
+
const transition = resolveTransition(transitions?.[i], clipSpanDuration(clips[i]), clipSpanDuration(clips[i + 1]));
|
|
388
|
+
if (transition.type !== "none" && transition.duration > 0) return true;
|
|
389
|
+
}
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
function buildTransitionSegments(clips, transitions) {
|
|
393
|
+
const segments = [];
|
|
394
|
+
let start = 0;
|
|
395
|
+
for (let i = 0; i < clips.length - 1; i++) {
|
|
396
|
+
const transition = resolveTransition(transitions?.[i], clipSpanDuration(clips[i]), clipSpanDuration(clips[i + 1]));
|
|
397
|
+
if (transition.type !== "none" && transition.duration > 0) {
|
|
398
|
+
segments.push({ start, end: i, transition });
|
|
399
|
+
start = i + 1;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
segments.push({ start, end: clips.length - 1, transition: null });
|
|
403
|
+
return segments;
|
|
404
|
+
}
|
|
405
|
+
function segmentClipDuration(clips, start, end) {
|
|
406
|
+
let total = 0;
|
|
407
|
+
for (let i = start; i <= end; i++) total += clipSpanDuration(clips[i]);
|
|
408
|
+
return total;
|
|
409
|
+
}
|
|
410
|
+
function buildTransitionTimeline(parts, clips, transitions, keepAudio) {
|
|
411
|
+
const segments = buildTransitionSegments(clips, transitions);
|
|
412
|
+
const builtSegments = segments.map((segment, segmentIndex) => {
|
|
413
|
+
const duration = segmentClipDuration(clips, segment.start, segment.end);
|
|
414
|
+
if (segment.start === segment.end) {
|
|
415
|
+
return {
|
|
416
|
+
vLabel: `[v${segment.start}]`,
|
|
417
|
+
aLabel: keepAudio ? `[a${segment.start}]` : "",
|
|
418
|
+
duration,
|
|
419
|
+
transition: segment.transition
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const inputs = [];
|
|
423
|
+
for (let i = segment.start; i <= segment.end; i++) {
|
|
424
|
+
inputs.push(keepAudio ? `[v${i}][a${i}]` : `[v${i}]`);
|
|
425
|
+
}
|
|
426
|
+
const vLabel = `[sgv${segmentIndex}]`;
|
|
427
|
+
const aLabel = keepAudio ? `[sga${segmentIndex}]` : "";
|
|
428
|
+
parts.push(
|
|
429
|
+
`${inputs.join("")}concat=n=${segment.end - segment.start + 1}:v=1:a=${keepAudio ? 1 : 0}${keepAudio ? `${vLabel}${aLabel}` : vLabel}`
|
|
430
|
+
);
|
|
431
|
+
return { vLabel, aLabel, duration, transition: segment.transition };
|
|
432
|
+
});
|
|
433
|
+
let currentV = builtSegments[0].vLabel;
|
|
434
|
+
let currentA = keepAudio ? builtSegments[0].aLabel : "";
|
|
435
|
+
let currentDuration = builtSegments[0].duration;
|
|
436
|
+
for (let i = 1; i < builtSegments.length; i++) {
|
|
437
|
+
const transition = builtSegments[i - 1].transition;
|
|
438
|
+
const next = builtSegments[i];
|
|
439
|
+
const vOut = `[vx${i}]`;
|
|
440
|
+
const offset = Math.max(0, currentDuration - transition.duration);
|
|
441
|
+
parts.push(`${currentV}${next.vLabel}xfade=transition=${transition.effect}:duration=${transition.duration}:offset=${offset}${vOut}`);
|
|
442
|
+
currentV = vOut;
|
|
443
|
+
if (keepAudio) {
|
|
444
|
+
const aOut = `[ax${i}]`;
|
|
445
|
+
parts.push(`${currentA}${next.aLabel}acrossfade=d=${transition.duration}:c1=${transition.curve}:c2=${transition.curve}${aOut}`);
|
|
446
|
+
currentA = aOut;
|
|
447
|
+
}
|
|
448
|
+
currentDuration = currentDuration + next.duration - transition.duration;
|
|
449
|
+
}
|
|
450
|
+
return { vLabel: currentV, aLabel: currentA, duration: currentDuration };
|
|
451
|
+
}
|
|
452
|
+
function codecArgs(withAudio) {
|
|
453
|
+
const args = ["-c:v", "libx264", "-preset", "veryfast", "-pix_fmt", "yuv420p", "-movflags", "+faststart"];
|
|
454
|
+
if (withAudio) args.push("-c:a", "aac");
|
|
455
|
+
return args;
|
|
456
|
+
}
|
|
457
|
+
var AFORMAT = "aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo";
|
|
458
|
+
var ANULL = "anullsrc=r=44100:cl=stereo";
|
|
459
|
+
function declick(dur) {
|
|
460
|
+
if (!(dur > 0.02)) return "";
|
|
461
|
+
const st = Math.round((dur - 0.01) * 1e3) / 1e3;
|
|
462
|
+
return `,afade=t=in:st=0:d=0.01,afade=t=out:st=${st}:d=0.01`;
|
|
463
|
+
}
|
|
464
|
+
var LIMITER = "alimiter=limit=0.95:level=disabled:latency=1";
|
|
465
|
+
function buildSingleSourceArgs(state, input, output, overlayInput, hasAudio) {
|
|
466
|
+
const vf = buildVideoFilters(state);
|
|
467
|
+
const clips = state.clips;
|
|
468
|
+
const keepAudio = state.keepAudio && hasAudio;
|
|
469
|
+
const multi = clips.length >= 2;
|
|
470
|
+
if (multi || overlayInput) {
|
|
471
|
+
const parts = [];
|
|
472
|
+
let vLabel;
|
|
473
|
+
if (multi) {
|
|
474
|
+
clips.forEach((c, i) => {
|
|
475
|
+
parts.push(`[0:v]trim=start=${c.in}:end=${c.out},setpts=PTS-STARTPTS[v${i}]`);
|
|
476
|
+
if (keepAudio) {
|
|
477
|
+
parts.push(`[0:a]atrim=start=${c.in}:end=${c.out},asetpts=PTS-STARTPTS${declick(c.out - c.in)}[a${i}]`);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
const concatInputs = clips.map((_, i) => keepAudio ? `[v${i}][a${i}]` : `[v${i}]`).join("");
|
|
481
|
+
const concatOuts = keepAudio ? "[vcat][acat]" : "[vcat]";
|
|
482
|
+
parts.push(`${concatInputs}concat=n=${clips.length}:v=1:a=${keepAudio ? 1 : 0}${concatOuts}`);
|
|
483
|
+
vLabel = "[vcat]";
|
|
484
|
+
} else {
|
|
485
|
+
vLabel = "[0:v]";
|
|
486
|
+
}
|
|
487
|
+
if (vf.length) {
|
|
488
|
+
parts.push(`${vLabel}${vf.join(",")}[vflt]`);
|
|
489
|
+
vLabel = "[vflt]";
|
|
490
|
+
}
|
|
491
|
+
if (overlayInput) {
|
|
492
|
+
parts.push(`${vLabel}[1:v]overlay=0:0[vout]`);
|
|
493
|
+
vLabel = "[vout]";
|
|
494
|
+
} else if (vLabel === "[0:v]") {
|
|
495
|
+
parts.push(`[0:v]null[vout]`);
|
|
496
|
+
vLabel = "[vout]";
|
|
497
|
+
}
|
|
498
|
+
const pre2 = [];
|
|
499
|
+
if (!multi && clips.length === 1) {
|
|
500
|
+
pre2.push("-ss", String(clips[0].in), "-t", String(clips[0].out - clips[0].in));
|
|
501
|
+
}
|
|
502
|
+
const args2 = ["-y", ...pre2, "-i", input];
|
|
503
|
+
if (overlayInput) args2.push("-i", overlayInput);
|
|
504
|
+
args2.push("-filter_complex", parts.join(";"), "-map", vLabel);
|
|
505
|
+
if (keepAudio) args2.push("-map", multi ? "[acat]" : "0:a?");
|
|
506
|
+
args2.push(...codecArgs(keepAudio));
|
|
507
|
+
args2.push(output);
|
|
508
|
+
return args2;
|
|
509
|
+
}
|
|
510
|
+
const pre = ["-ss", String(clips[0].in), "-t", String(clips[0].out - clips[0].in)];
|
|
511
|
+
const args = ["-y", ...pre, "-i", input];
|
|
512
|
+
if (vf.length) args.push("-vf", vf.join(","));
|
|
513
|
+
if (!keepAudio) args.push("-an");
|
|
514
|
+
args.push(...codecArgs(keepAudio));
|
|
515
|
+
args.push(output);
|
|
516
|
+
return args;
|
|
517
|
+
}
|
|
518
|
+
function buildFfmpegArgs(state, io, output) {
|
|
519
|
+
const { videoPaths, videoHasAudio, audioPaths, overlayPath } = io;
|
|
520
|
+
const music = state.audioClips ?? [];
|
|
521
|
+
const activeTransitions = hasActiveTransitions(state.transitions, state.clips);
|
|
522
|
+
if (videoPaths.length === 1 && music.length === 0 && !activeTransitions) {
|
|
523
|
+
return buildSingleSourceArgs(state, videoPaths[0], output, overlayPath, videoHasAudio[0] ?? false);
|
|
524
|
+
}
|
|
525
|
+
const N = videoPaths.length;
|
|
526
|
+
const M = audioPaths.length;
|
|
527
|
+
const cw = state.canvas.w;
|
|
528
|
+
const ch = state.canvas.h;
|
|
529
|
+
const clips = state.clips;
|
|
530
|
+
const keepAudio = state.keepAudio && clips.some((c) => videoHasAudio[c.srcIdx]);
|
|
531
|
+
const total = clips.reduce((s, c) => s + (c.out - c.in), 0);
|
|
532
|
+
const parts = [];
|
|
533
|
+
clips.forEach((c, i) => {
|
|
534
|
+
parts.push(
|
|
535
|
+
`[${c.srcIdx}:v]trim=start=${c.in}:end=${c.out},setpts=PTS-STARTPTS,scale=${cw}:${ch}:force_original_aspect_ratio=increase,crop=${cw}:${ch},setsar=1,fps=30,format=yuv420p[v${i}]`
|
|
536
|
+
);
|
|
537
|
+
if (keepAudio) {
|
|
538
|
+
if (videoHasAudio[c.srcIdx]) {
|
|
539
|
+
parts.push(
|
|
540
|
+
`[${c.srcIdx}:a]atrim=start=${c.in}:end=${c.out},asetpts=PTS-STARTPTS${declick(c.out - c.in)},${AFORMAT}[a${i}]`
|
|
541
|
+
);
|
|
542
|
+
} else {
|
|
543
|
+
parts.push(`${ANULL},atrim=start=0:end=${c.out - c.in},asetpts=PTS-STARTPTS,${AFORMAT}[a${i}]`);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
let vLabel = "[vcat]";
|
|
548
|
+
let aLabel = keepAudio ? "[acat]" : "";
|
|
549
|
+
let effectiveTotal = total;
|
|
550
|
+
if (activeTransitions) {
|
|
551
|
+
const timeline = buildTransitionTimeline(parts, clips, state.transitions ?? [], keepAudio);
|
|
552
|
+
vLabel = timeline.vLabel;
|
|
553
|
+
aLabel = keepAudio ? timeline.aLabel : "";
|
|
554
|
+
effectiveTotal = timeline.duration;
|
|
555
|
+
} else {
|
|
556
|
+
const concatInputs = clips.map((_, i) => keepAudio ? `[v${i}][a${i}]` : `[v${i}]`).join("");
|
|
557
|
+
parts.push(`${concatInputs}concat=n=${clips.length}:v=1:a=${keepAudio ? 1 : 0}${keepAudio ? "[vcat][acat]" : "[vcat]"}`);
|
|
558
|
+
}
|
|
559
|
+
if (!keepAudio && music.length) {
|
|
560
|
+
parts.push(`${ANULL},atrim=start=0:end=${effectiveTotal},asetpts=PTS-STARTPTS,${AFORMAT}[acat]`);
|
|
561
|
+
aLabel = "[acat]";
|
|
562
|
+
}
|
|
563
|
+
if (music.length) {
|
|
564
|
+
music.forEach((a, j) => {
|
|
565
|
+
const ms = Math.max(0, Math.round(a.startAt * 1e3));
|
|
566
|
+
parts.push(
|
|
567
|
+
`[${N + j}:a]atrim=start=${a.in}:end=${a.out},asetpts=PTS-STARTPTS,volume=${a.volume},${AFORMAT},adelay=${ms}|${ms}[mu${j}]`
|
|
568
|
+
);
|
|
569
|
+
});
|
|
570
|
+
const mixInputs = `${aLabel}${music.map((_, j) => `[mu${j}]`).join("")}`;
|
|
571
|
+
parts.push(
|
|
572
|
+
`${mixInputs}amix=inputs=${1 + music.length}:duration=first:dropout_transition=0:normalize=0,${LIMITER}[aout]`
|
|
573
|
+
);
|
|
574
|
+
aLabel = "[aout]";
|
|
575
|
+
}
|
|
576
|
+
const vf = buildVideoFilters(state);
|
|
577
|
+
if (vf.length) {
|
|
578
|
+
parts.push(`${vLabel}${vf.join(",")}[vflt]`);
|
|
579
|
+
vLabel = "[vflt]";
|
|
580
|
+
}
|
|
581
|
+
if (overlayPath) {
|
|
582
|
+
parts.push(`${vLabel}[${N + M}:v]overlay=0:0[vout]`);
|
|
583
|
+
vLabel = "[vout]";
|
|
584
|
+
}
|
|
585
|
+
const args = ["-y"];
|
|
586
|
+
for (const p of videoPaths) args.push("-i", p);
|
|
587
|
+
for (const p of audioPaths) args.push("-i", p);
|
|
588
|
+
if (overlayPath) args.push("-i", overlayPath);
|
|
589
|
+
args.push("-filter_complex", parts.join(";"), "-map", vLabel);
|
|
590
|
+
const withAudio = !!aLabel;
|
|
591
|
+
if (withAudio) args.push("-map", aLabel);
|
|
592
|
+
args.push(...codecArgs(withAudio));
|
|
593
|
+
if (withAudio) args.push("-ar", "44100", "-ac", "2");
|
|
594
|
+
args.push(output);
|
|
595
|
+
return args;
|
|
596
|
+
}
|
|
597
|
+
function buildPosterArgs(input, time, output) {
|
|
598
|
+
return ["-y", "-ss", String(time), "-i", input, "-frames:v", "1", "-q:v", "2", output];
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/history.ts
|
|
602
|
+
var MAX_DEPTH = 100;
|
|
603
|
+
function createHistory(initial) {
|
|
604
|
+
return { past: [], present: initial, future: [] };
|
|
605
|
+
}
|
|
606
|
+
function pushHistory(h, next) {
|
|
607
|
+
if (next === h.present) return h;
|
|
608
|
+
const past = [...h.past, h.present];
|
|
609
|
+
if (past.length > MAX_DEPTH) past.shift();
|
|
610
|
+
return { past, present: next, future: [] };
|
|
611
|
+
}
|
|
612
|
+
function replacePresent(h, next) {
|
|
613
|
+
if (next === h.present) return h;
|
|
614
|
+
return { ...h, present: next };
|
|
615
|
+
}
|
|
616
|
+
function canUndo(h) {
|
|
617
|
+
return h.past.length > 0;
|
|
618
|
+
}
|
|
619
|
+
function canRedo(h) {
|
|
620
|
+
return h.future.length > 0;
|
|
621
|
+
}
|
|
622
|
+
function undo(h) {
|
|
623
|
+
if (!canUndo(h)) return h;
|
|
624
|
+
const past = h.past.slice(0, -1);
|
|
625
|
+
return { past, present: h.past[h.past.length - 1], future: [h.present, ...h.future] };
|
|
626
|
+
}
|
|
627
|
+
function redo(h) {
|
|
628
|
+
if (!canRedo(h)) return h;
|
|
629
|
+
const [next, ...future] = h.future;
|
|
630
|
+
return { past: [...h.past, h.present], present: next, future };
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// src/i18n.ts
|
|
634
|
+
var zh = {
|
|
635
|
+
// 工具卡
|
|
636
|
+
"tool.trim": "\u526A\u8F91",
|
|
637
|
+
"tool.crop": "\u88C1\u526A",
|
|
638
|
+
"tool.tune": "\u8C03\u8272",
|
|
639
|
+
"tool.filter": "\u6EE4\u955C",
|
|
640
|
+
"tool.annotate": "\u6807\u6CE8",
|
|
641
|
+
"tool.sticker": "\u8D34\u7EB8",
|
|
642
|
+
"tool.resize": "\u6BD4\u4F8B",
|
|
643
|
+
// 调色项
|
|
644
|
+
"tune.brightness": "\u4EAE\u5EA6",
|
|
645
|
+
"tune.contrast": "\u5BF9\u6BD4",
|
|
646
|
+
"tune.saturation": "\u9971\u548C",
|
|
647
|
+
"tune.gamma": "Gamma",
|
|
648
|
+
// 标注工具
|
|
649
|
+
"overlay.select": "\u9009\u62E9",
|
|
650
|
+
"overlay.pen": "\u753B\u7B14",
|
|
651
|
+
"overlay.eraser": "\u6A61\u76AE",
|
|
652
|
+
"overlay.line": "\u76F4\u7EBF",
|
|
653
|
+
"overlay.arrow": "\u7BAD\u5934",
|
|
654
|
+
"overlay.rect": "\u77E9\u5F62",
|
|
655
|
+
"overlay.ellipse": "\u692D\u5706",
|
|
656
|
+
"overlay.text": "\u6587\u5B57",
|
|
657
|
+
"overlay.color": "\u7EBF\u8272",
|
|
658
|
+
"overlay.width": "\u7EBF\u5BBD",
|
|
659
|
+
"overlay.copySelected": "\u590D\u5236",
|
|
660
|
+
"overlay.delSelected": "\u5220\u9664\u9009\u4E2D",
|
|
661
|
+
"overlay.editSelected": "\u7F16\u8F91",
|
|
662
|
+
"overlay.pickImage": "\u9009\u62E9\u56FE\u7247",
|
|
663
|
+
"overlay.hint": "\u70B9 emoji/\u56FE\u7247\u6DFB\u52A0 \u2192 \u753B\u5E03\u4E0A\u62D6\u52A8\u6446\u4F4D,\u62D6\u53F3\u4E0B\u89D2\u7D2B\u8272\u628A\u624B\u7F29\u653E",
|
|
664
|
+
"overlay.textPlaceholder": "\u8F93\u5165\u6587\u5B57,\u56DE\u8F66\u786E\u8BA4",
|
|
665
|
+
// 滤镜预设
|
|
666
|
+
"filter.none": "\u539F\u56FE",
|
|
667
|
+
"filter.bw": "\u9ED1\u767D",
|
|
668
|
+
"filter.sepia": "\u590D\u53E4",
|
|
669
|
+
"filter.warm": "\u6696\u9633",
|
|
670
|
+
"filter.cool": "\u51B7\u8C03",
|
|
671
|
+
"filter.vivid": "\u9C9C\u8273",
|
|
672
|
+
// 比例
|
|
673
|
+
"ratio.orig": "\u539F\u59CB",
|
|
674
|
+
"ratio.free": "\u81EA\u7531\u6BD4\u4F8B",
|
|
675
|
+
"ratio.9:16": "\u7AD6\u5C4F 9:16",
|
|
676
|
+
"ratio.16:9": "\u6A2A\u5C4F 16:9",
|
|
677
|
+
"ratio.1:1": "\u65B9\u5F62 1:1",
|
|
678
|
+
"ratio.4:5": "\u7AD6\u56FE 4:5",
|
|
679
|
+
// 动作
|
|
680
|
+
"act.fit": "\u9002\u5E94",
|
|
681
|
+
"act.zoomFit": "\u7F29\u653E\u81F3\u9002\u5F53\u5927\u5C0F",
|
|
682
|
+
"act.zoomTo": "\u7F29\u653E\u81F3 {value}%",
|
|
683
|
+
"act.split": "\u5206\u5272",
|
|
684
|
+
"act.copy": "\u590D\u5236",
|
|
685
|
+
"act.delete": "\u5220\u9664",
|
|
686
|
+
"act.restore": "\u8FD8\u539F",
|
|
687
|
+
"act.deleteMusic": "\u5220\u9664\u97F3\u4E50",
|
|
688
|
+
"act.cancel": "\u53D6\u6D88",
|
|
689
|
+
"act.exportPoster": "\u5BFC\u51FA\u5C01\u9762",
|
|
690
|
+
"act.exporting": "\u5BFC\u51FA\u4E2D\u2026",
|
|
691
|
+
"act.poster": "\u{1F5BC} \u5C01\u9762",
|
|
692
|
+
"act.again": "\u518D\u6B21\u4E0B\u8F7D",
|
|
693
|
+
"act.saveDrive": "\u5B58\u7F51\u76D8",
|
|
694
|
+
"act.changeImage": "\u2190 \u6362\u4E00\u5F20",
|
|
695
|
+
"act.changeVideo": "\u2190 \u6362\u4E00\u4E2A",
|
|
696
|
+
"crop.rotateLeft": "\u21BA \u5411\u5DE6\u65CB\u8F6C",
|
|
697
|
+
"crop.flipX": "\u21CB \u6C34\u5E73\u7FFB\u8F6C",
|
|
698
|
+
"crop.flipY": "\u21F5 \u5782\u76F4\u7FFB\u8F6C",
|
|
699
|
+
"crop.rotateLeftShort": "\u5DE6\u8F6C",
|
|
700
|
+
"crop.flipXShort": "\u6A2A\u7FFB",
|
|
701
|
+
"crop.flipYShort": "\u7AD6\u7FFB",
|
|
702
|
+
// 提示(title)
|
|
703
|
+
"tip.close": "\u5173\u95ED(\u6362\u6587\u4EF6)",
|
|
704
|
+
"tip.undo": "\u64A4\u9500",
|
|
705
|
+
"tip.redo": "\u91CD\u505A",
|
|
706
|
+
"tip.resetOpened": "\u91CD\u7F6E\u5230\u6253\u5F00\u6587\u4EF6\u65F6",
|
|
707
|
+
"tip.previewZoom": "\u9884\u89C8\u7F29\u653E\u6BD4\u4F8B",
|
|
708
|
+
"tip.previewZoomOut": "\u7F29\u5C0F\u9884\u89C8",
|
|
709
|
+
"tip.previewZoomIn": "\u653E\u5927\u9884\u89C8",
|
|
710
|
+
"tip.previewZoomFit": "\u9002\u5E94\u9884\u89C8",
|
|
711
|
+
"tip.previewPointer": "\u6307\u9488\u5DE5\u5177",
|
|
712
|
+
"tip.previewPan": "\u624B\u5DE5\u5177\uFF1A\u62D6\u52A8\u753B\u9762",
|
|
713
|
+
"tip.poster": "\u9884\u89C8\u5E76\u9009\u62E9\u5C01\u9762\u5E27",
|
|
714
|
+
"tip.keepAudio": "\u539F\u89C6\u9891\u58F0\u97F3\u5F00\u5173(\u4E0E\u97F3\u4E50\u6DF7\u97F3;\u9884\u89C8\u540C\u6B65)",
|
|
715
|
+
"tip.split": "\u5728\u64AD\u653E\u5934\u5904\u628A\u5F53\u524D\u7247\u6BB5\u4E00\u5206\u4E3A\u4E8C",
|
|
716
|
+
"tip.zoomOut": "\u7F29\u5C0F\u65F6\u95F4\u8F74(Ctrl+\u6EDA\u8F6E)",
|
|
717
|
+
"tip.zoomIn": "\u653E\u5927\u65F6\u95F4\u8F74(Ctrl+\u6EDA\u8F6E)",
|
|
718
|
+
"tip.fit": "\u7F29\u653E\u5230\u9002\u5E94\u5BBD\u5EA6",
|
|
719
|
+
"tip.addVideo": "\u6DFB\u52A0\u89C6\u9891\u7247\u6BB5",
|
|
720
|
+
"tip.addAudio": "\u6DFB\u52A0\u97F3\u4E50(\u97F3\u9891\u6587\u4EF6,\u6216\u9009\u542B\u58F0\u97F3\u7684\u89C6\u9891\u81EA\u52A8\u63D0\u53D6\u97F3\u8F68;\u4E0E\u539F\u58F0\u6DF7\u97F3)",
|
|
721
|
+
"tip.dupClip": "\u590D\u5236\u8BE5\u7247\u6BB5(\u63D2\u5230\u5176\u540E)",
|
|
722
|
+
"tip.delClip": "\u5220\u9664\u8BE5\u7247\u6BB5",
|
|
723
|
+
"tip.lockAspect": "\u9501\u5B9A\u7EB5\u6A2A\u6BD4",
|
|
724
|
+
"tip.dblConfirm": "\u53CC\u51FB\u786E\u8BA4\u88C1\u526A",
|
|
725
|
+
// 错误
|
|
726
|
+
"err.notVideo": "\u8BF7\u9009\u62E9\u89C6\u9891\u6587\u4EF6",
|
|
727
|
+
"err.maxVideo": "\u6700\u591A {max} \u4E2A\u89C6\u9891\u7D20\u6750",
|
|
728
|
+
"err.videoLoad": "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25,\u8BF7\u6362\u4E00\u4E2A\u6587\u4EF6",
|
|
729
|
+
"err.notAudio": "\u8BF7\u9009\u62E9\u97F3\u9891\u6587\u4EF6(mp3/wav/m4a),\u6216\u542B\u58F0\u97F3\u7684\u89C6\u9891(\u81EA\u52A8\u63D0\u53D6\u97F3\u8F68)",
|
|
730
|
+
"err.maxAudio": "\u6700\u591A {max} \u4E2A\u97F3\u9891\u7D20\u6750",
|
|
731
|
+
"err.audioLoad": "\u97F3\u9891\u52A0\u8F7D\u5931\u8D25,\u8BF7\u6362\u4E00\u4E2A\u6587\u4EF6",
|
|
732
|
+
"err.processFailed": "\u5904\u7406\u5931\u8D25",
|
|
733
|
+
"err.posterFailed": "\u5C01\u9762\u6E32\u67D3\u5931\u8D25",
|
|
734
|
+
"err.canvas": "canvas \u4E0D\u53EF\u7528",
|
|
735
|
+
"err.imageRead": "\u56FE\u7247\u8BFB\u53D6\u5931\u8D25,\u8BF7\u6362\u4E00\u5F20",
|
|
736
|
+
"err.notImage": "\u8BF7\u9009\u62E9\u56FE\u7247\u6587\u4EF6",
|
|
737
|
+
"err.fileType": "\u53EA\u652F\u6301\u56FE\u7247\u6216\u89C6\u9891\u6587\u4EF6",
|
|
738
|
+
"err.saveDrive": "\u5B58\u7F51\u76D8\u5931\u8D25",
|
|
739
|
+
// 状态
|
|
740
|
+
"msg.processing": "\u6B63\u5728\u5BFC\u51FA\u4E2D\u2026",
|
|
741
|
+
"msg.exportingHint": "\u8BF7\u7A0D\u5019\uFF0C\u5BFC\u51FA\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u8FD4\u56DE\u7ED3\u679C\u3002",
|
|
742
|
+
"msg.done": "\u5B8C\u6210 \u2713",
|
|
743
|
+
"msg.loading": "\u7D20\u6750\u52A0\u8F7D\u4E2D\u2026",
|
|
744
|
+
"msg.exported": "\u5DF2\u5BFC\u51FA\uFF1A",
|
|
745
|
+
"msg.saving": "\u5B58\u7F51\u76D8\u4E2D\u2026",
|
|
746
|
+
"msg.saved": "\u5DF2\u5B58\u5230\u7F51\u76D8 \u2713",
|
|
747
|
+
// 视频视图文案
|
|
748
|
+
"lbl.ratioSection": "\u753B\u9762\u6BD4\u4F8B(\u88C1\u526A,\u4E0D\u53D8\u5F62)",
|
|
749
|
+
"lbl.dragToReposition": "\u2194 \u62D6\u52A8\u9884\u89C8\u53EF\u8C03\u6574\u88C1\u526A\u4F4D\u7F6E",
|
|
750
|
+
"lbl.sizeSection": "\u5BFC\u51FA\u5C3A\u5BF8(\u50CF\u7D20;\u6BD4\u4F8B\u4E0D\u7B26\u65F6 cover \u5C45\u4E2D\u88C1\u526A)",
|
|
751
|
+
"lbl.currentOut": "\u5F53\u524D\u8F93\u51FA",
|
|
752
|
+
"lbl.zoomSize": "\u5927\u5C0F",
|
|
753
|
+
"lbl.noScale": "(\u672A\u7F29\u653E)",
|
|
754
|
+
"lbl.coverNote": "\xB7 \u6BD4\u4F8B\u4E0D\u4E00\u81F4\u65F6\u5C45\u4E2D\u88C1\u526A(cover),\u4E0D\u53D8\u5F62",
|
|
755
|
+
"lbl.audioTrackHint": "\u266A \u97F3\u9891\u8F68(\u53F3\u4FA7 \uFF0B \u6DFB\u52A0\u97F3\u4E50,\u4E0E\u539F\u58F0\u6DF7\u97F3)",
|
|
756
|
+
"lbl.volume": "\u97F3\u91CF",
|
|
757
|
+
"lbl.volNote": "(\u9884\u89C8\u6700\u5927 100%,\u5BFC\u51FA\u6309\u8BBE\u5B9A\u503C)",
|
|
758
|
+
"lbl.music": "\u97F3\u4E50",
|
|
759
|
+
"kbd.fit": "\u21E7 F",
|
|
760
|
+
// 封面弹层
|
|
761
|
+
"poster.title": "\u9009\u62E9\u5C01\u9762\u5E27",
|
|
762
|
+
// 面板层
|
|
763
|
+
"panel.title": "\u5A92\u4F53\u7F16\u8F91\u5668",
|
|
764
|
+
"panel.subtitle": "\u4E0A\u4F20\u56FE\u7247 / \u89C6\u9891\uFF0C\u88C1\u526A \xB7 \u6EE4\u955C \xB7 \u6587\u5B57 \xB7 \u5BFC\u51FA",
|
|
765
|
+
"panel.pick": "\u70B9\u51FB\u9009\u62E9\u56FE\u7247\u6216\u89C6\u9891",
|
|
766
|
+
"panel.pickHint": "\u56FE\u7247\u7528 Filerobot \xB7 \u89C6\u9891\u53EF\u88C1\u526A/\u9759\u97F3/\u5C01\u9762"
|
|
767
|
+
};
|
|
768
|
+
var en = {
|
|
769
|
+
"tool.trim": "Trim",
|
|
770
|
+
"tool.crop": "Crop",
|
|
771
|
+
"tool.tune": "Tune",
|
|
772
|
+
"tool.filter": "Filters",
|
|
773
|
+
"tool.annotate": "Annotate",
|
|
774
|
+
"tool.sticker": "Stickers",
|
|
775
|
+
"tool.resize": "Ratio",
|
|
776
|
+
"tune.brightness": "Brightness",
|
|
777
|
+
"tune.contrast": "Contrast",
|
|
778
|
+
"tune.saturation": "Saturation",
|
|
779
|
+
"tune.gamma": "Gamma",
|
|
780
|
+
"overlay.select": "Select",
|
|
781
|
+
"overlay.pen": "Pen",
|
|
782
|
+
"overlay.eraser": "Eraser",
|
|
783
|
+
"overlay.line": "Line",
|
|
784
|
+
"overlay.arrow": "Arrow",
|
|
785
|
+
"overlay.rect": "Rect",
|
|
786
|
+
"overlay.ellipse": "Ellipse",
|
|
787
|
+
"overlay.text": "Text",
|
|
788
|
+
"overlay.color": "Color",
|
|
789
|
+
"overlay.width": "Width",
|
|
790
|
+
"overlay.copySelected": "Copy",
|
|
791
|
+
"overlay.delSelected": "Delete selected",
|
|
792
|
+
"overlay.editSelected": "Edit",
|
|
793
|
+
"overlay.pickImage": "Pick image",
|
|
794
|
+
"overlay.hint": "Tap emoji/image to add \u2192 drag to place, drag the purple corner handle to scale",
|
|
795
|
+
"overlay.textPlaceholder": "Type text, Enter to confirm",
|
|
796
|
+
"filter.none": "Original",
|
|
797
|
+
"filter.bw": "B&W",
|
|
798
|
+
"filter.sepia": "Sepia",
|
|
799
|
+
"filter.warm": "Warm",
|
|
800
|
+
"filter.cool": "Cool",
|
|
801
|
+
"filter.vivid": "Vivid",
|
|
802
|
+
"ratio.orig": "Original",
|
|
803
|
+
"ratio.free": "Free ratio",
|
|
804
|
+
"ratio.9:16": "Portrait 9:16",
|
|
805
|
+
"ratio.16:9": "Landscape 16:9",
|
|
806
|
+
"ratio.1:1": "Square 1:1",
|
|
807
|
+
"ratio.4:5": "Vertical 4:5",
|
|
808
|
+
"act.fit": "Fit",
|
|
809
|
+
"act.zoomFit": "Zoom to fit",
|
|
810
|
+
"act.zoomTo": "Zoom to {value}%",
|
|
811
|
+
"act.split": "Split",
|
|
812
|
+
"act.copy": "Copy",
|
|
813
|
+
"act.delete": "Delete",
|
|
814
|
+
"act.restore": "Reset",
|
|
815
|
+
"act.deleteMusic": "Remove music",
|
|
816
|
+
"act.cancel": "Cancel",
|
|
817
|
+
"act.exportPoster": "Export cover",
|
|
818
|
+
"act.exporting": "Exporting\u2026",
|
|
819
|
+
"act.poster": "\u{1F5BC} Cover",
|
|
820
|
+
"act.again": "Download again",
|
|
821
|
+
"act.saveDrive": "Save to drive",
|
|
822
|
+
"act.changeImage": "\u2190 Change image",
|
|
823
|
+
"act.changeVideo": "\u2190 Change file",
|
|
824
|
+
"crop.rotateLeft": "\u21BA Rotate left",
|
|
825
|
+
"crop.flipX": "\u21CB Flip horizontal",
|
|
826
|
+
"crop.flipY": "\u21F5 Flip vertical",
|
|
827
|
+
"crop.rotateLeftShort": "Rot",
|
|
828
|
+
"crop.flipXShort": "Flip",
|
|
829
|
+
"crop.flipYShort": "Flip",
|
|
830
|
+
"tip.close": "Close (change file)",
|
|
831
|
+
"tip.undo": "Undo",
|
|
832
|
+
"tip.redo": "Redo",
|
|
833
|
+
"tip.resetOpened": "Reset to opened file",
|
|
834
|
+
"tip.previewZoom": "Preview zoom",
|
|
835
|
+
"tip.previewZoomOut": "Zoom out preview",
|
|
836
|
+
"tip.previewZoomIn": "Zoom in preview",
|
|
837
|
+
"tip.previewZoomFit": "Fit preview",
|
|
838
|
+
"tip.previewPointer": "Pointer tool",
|
|
839
|
+
"tip.previewPan": "Hand tool: pan canvas",
|
|
840
|
+
"tip.poster": "Preview and pick a cover frame",
|
|
841
|
+
"tip.keepAudio": "Original audio on/off (mixed with music; preview follows)",
|
|
842
|
+
"tip.split": "Split the current clip at the playhead",
|
|
843
|
+
"tip.zoomOut": "Zoom out timeline (Ctrl+wheel)",
|
|
844
|
+
"tip.zoomIn": "Zoom in timeline (Ctrl+wheel)",
|
|
845
|
+
"tip.fit": "Fit to width",
|
|
846
|
+
"tip.addVideo": "Add video clip",
|
|
847
|
+
"tip.addAudio": "Add music (audio file, or a video with sound to extract its track; mixed with original)",
|
|
848
|
+
"tip.dupClip": "Duplicate clip (insert after)",
|
|
849
|
+
"tip.delClip": "Delete clip",
|
|
850
|
+
"tip.lockAspect": "Lock aspect ratio",
|
|
851
|
+
"tip.dblConfirm": "Double-click to confirm crop",
|
|
852
|
+
"err.notVideo": "Please choose a video file",
|
|
853
|
+
"err.maxVideo": "Up to {max} video sources",
|
|
854
|
+
"err.videoLoad": "Failed to load video, try another file",
|
|
855
|
+
"err.notAudio": "Choose an audio file (mp3/wav/m4a), or a video with sound (audio auto-extracted)",
|
|
856
|
+
"err.maxAudio": "Up to {max} audio sources",
|
|
857
|
+
"err.audioLoad": "Failed to load audio, try another file",
|
|
858
|
+
"err.processFailed": "Processing failed",
|
|
859
|
+
"err.posterFailed": "Failed to render cover",
|
|
860
|
+
"err.canvas": "Canvas unavailable",
|
|
861
|
+
"err.imageRead": "Failed to read image, try another",
|
|
862
|
+
"err.notImage": "Please choose an image file",
|
|
863
|
+
"err.fileType": "Only image or video files are supported",
|
|
864
|
+
"err.saveDrive": "Failed to save to drive",
|
|
865
|
+
"msg.processing": "Exporting\u2026",
|
|
866
|
+
"msg.exportingHint": "Please wait. The result will be returned automatically when export finishes.",
|
|
867
|
+
"msg.done": "Done \u2713",
|
|
868
|
+
"msg.loading": "Loading media\u2026",
|
|
869
|
+
"msg.exported": "Exported: ",
|
|
870
|
+
"msg.saving": "Saving\u2026",
|
|
871
|
+
"msg.saved": "Saved to drive \u2713",
|
|
872
|
+
"lbl.ratioSection": "Frame ratio (crop, no distortion)",
|
|
873
|
+
"lbl.dragToReposition": "\u2194 Drag the preview to reposition the crop",
|
|
874
|
+
"lbl.sizeSection": "Export size (px; cover center-crop when ratios differ)",
|
|
875
|
+
"lbl.currentOut": "Output",
|
|
876
|
+
"lbl.zoomSize": "Size",
|
|
877
|
+
"lbl.noScale": "(no scaling)",
|
|
878
|
+
"lbl.coverNote": "\xB7 center-cropped (cover) when ratios differ, no distortion",
|
|
879
|
+
"lbl.audioTrackHint": "\u266A Audio track (\uFF0B on the right to add music, mixed with original)",
|
|
880
|
+
"lbl.volume": "Volume",
|
|
881
|
+
"lbl.volNote": "(preview caps at 100%, export uses the set value)",
|
|
882
|
+
"lbl.music": "Music",
|
|
883
|
+
"kbd.fit": "\u21E7 F",
|
|
884
|
+
"poster.title": "Pick a cover frame",
|
|
885
|
+
"panel.title": "Media Editor",
|
|
886
|
+
"panel.subtitle": "Upload an image / video \u2014 crop \xB7 filters \xB7 text \xB7 export",
|
|
887
|
+
"panel.pick": "Click to choose an image or video",
|
|
888
|
+
"panel.pickHint": "Images via Filerobot \xB7 videos: trim/mute/cover"
|
|
889
|
+
};
|
|
890
|
+
var es = {
|
|
891
|
+
"tool.trim": "Editar",
|
|
892
|
+
"tool.crop": "Recortar",
|
|
893
|
+
"tool.tune": "Ajustar color",
|
|
894
|
+
"tool.filter": "Filtros",
|
|
895
|
+
"tool.annotate": "Anotar",
|
|
896
|
+
"tool.sticker": "Stickers",
|
|
897
|
+
"tool.resize": "Proporci\xF3n",
|
|
898
|
+
"tune.brightness": "Brillo",
|
|
899
|
+
"tune.contrast": "Contraste",
|
|
900
|
+
"tune.saturation": "Saturaci\xF3n",
|
|
901
|
+
"tune.gamma": "Gamma",
|
|
902
|
+
"overlay.select": "Seleccionar",
|
|
903
|
+
"overlay.pen": "Pincel",
|
|
904
|
+
"overlay.eraser": "Borrador",
|
|
905
|
+
"overlay.line": "L\xEDnea",
|
|
906
|
+
"overlay.arrow": "Flecha",
|
|
907
|
+
"overlay.rect": "Rect\xE1ngulo",
|
|
908
|
+
"overlay.ellipse": "Elipse",
|
|
909
|
+
"overlay.text": "Texto",
|
|
910
|
+
"overlay.color": "Color",
|
|
911
|
+
"overlay.width": "Grosor",
|
|
912
|
+
"overlay.copySelected": "Copiar",
|
|
913
|
+
"overlay.delSelected": "Eliminar seleccionado",
|
|
914
|
+
"overlay.editSelected": "Editar",
|
|
915
|
+
"overlay.pickImage": "Elegir imagen",
|
|
916
|
+
"overlay.hint": "Toca un emoji/imagen para a\xF1adirlo \u2192 arrastra para colocarlo, arrastra el tirador morado para escalar",
|
|
917
|
+
"overlay.textPlaceholder": "Escribe texto, Enter para confirmar",
|
|
918
|
+
"filter.none": "Original",
|
|
919
|
+
"filter.bw": "Blanco y negro",
|
|
920
|
+
"filter.sepia": "Sepia",
|
|
921
|
+
"filter.warm": "C\xE1lido",
|
|
922
|
+
"filter.cool": "Fr\xEDo",
|
|
923
|
+
"filter.vivid": "Intenso",
|
|
924
|
+
"ratio.orig": "Original",
|
|
925
|
+
"ratio.free": "Libre",
|
|
926
|
+
"ratio.9:16": "Vertical 9:16",
|
|
927
|
+
"ratio.16:9": "Horizontal 16:9",
|
|
928
|
+
"ratio.1:1": "Cuadrado 1:1",
|
|
929
|
+
"ratio.4:5": "Vertical 4:5",
|
|
930
|
+
"act.fit": "Ajustar",
|
|
931
|
+
"act.zoomFit": "Ajustar a pantalla",
|
|
932
|
+
"act.zoomTo": "Zoom al {value}%",
|
|
933
|
+
"act.split": "Dividir",
|
|
934
|
+
"act.copy": "Copiar",
|
|
935
|
+
"act.delete": "Eliminar",
|
|
936
|
+
"act.restore": "Restablecer",
|
|
937
|
+
"act.deleteMusic": "Quitar m\xFAsica",
|
|
938
|
+
"act.cancel": "Cancelar",
|
|
939
|
+
"act.exportPoster": "Exportar portada",
|
|
940
|
+
"act.exporting": "Exportando\u2026",
|
|
941
|
+
"act.poster": "\u{1F5BC} Portada",
|
|
942
|
+
"act.again": "Descargar de nuevo",
|
|
943
|
+
"act.saveDrive": "Guardar en disco",
|
|
944
|
+
"act.changeImage": "\u2190 Cambiar imagen",
|
|
945
|
+
"act.changeVideo": "\u2190 Cambiar archivo",
|
|
946
|
+
"crop.rotateLeft": "\u21BA Girar a la izquierda",
|
|
947
|
+
"crop.flipX": "\u21CB Voltear horizontal",
|
|
948
|
+
"crop.flipY": "\u21F5 Voltear vertical",
|
|
949
|
+
"crop.rotateLeftShort": "Giro",
|
|
950
|
+
"crop.flipXShort": "Flip",
|
|
951
|
+
"crop.flipYShort": "Flip",
|
|
952
|
+
"tip.close": "Cerrar (cambiar archivo)",
|
|
953
|
+
"tip.undo": "Deshacer",
|
|
954
|
+
"tip.redo": "Rehacer",
|
|
955
|
+
"tip.resetOpened": "Restablecer al archivo abierto",
|
|
956
|
+
"tip.previewZoom": "Zoom de vista previa",
|
|
957
|
+
"tip.previewZoomOut": "Reducir vista previa",
|
|
958
|
+
"tip.previewZoomIn": "Ampliar vista previa",
|
|
959
|
+
"tip.previewZoomFit": "Ajustar vista previa",
|
|
960
|
+
"tip.previewPointer": "Herramienta de puntero",
|
|
961
|
+
"tip.previewPan": "Mano: desplazar lienzo",
|
|
962
|
+
"tip.poster": "Previsualizar y elegir portada",
|
|
963
|
+
"tip.keepAudio": "Activar/desactivar audio original (mezclado con m\xFAsica; la vista previa lo refleja)",
|
|
964
|
+
"tip.split": "Dividir el clip actual en el cursor",
|
|
965
|
+
"tip.zoomOut": "Reducir l\xEDnea de tiempo (Ctrl+rueda)",
|
|
966
|
+
"tip.zoomIn": "Ampliar l\xEDnea de tiempo (Ctrl+rueda)",
|
|
967
|
+
"tip.fit": "Ajustar al ancho",
|
|
968
|
+
"tip.addVideo": "A\xF1adir clip de v\xEDdeo",
|
|
969
|
+
"tip.addAudio": "A\xF1adir m\xFAsica (archivo de audio o v\xEDdeo con sonido para extraer la pista; se mezcla con el original)",
|
|
970
|
+
"tip.dupClip": "Duplicar clip (insertar despu\xE9s)",
|
|
971
|
+
"tip.delClip": "Eliminar clip",
|
|
972
|
+
"tip.lockAspect": "Bloquear proporci\xF3n",
|
|
973
|
+
"tip.dblConfirm": "Doble clic para confirmar recorte",
|
|
974
|
+
"err.notVideo": "Elige un archivo de v\xEDdeo",
|
|
975
|
+
"err.maxVideo": "M\xE1ximo {max} v\xEDdeos",
|
|
976
|
+
"err.videoLoad": "No se pudo cargar el v\xEDdeo, prueba con otro archivo",
|
|
977
|
+
"err.notAudio": "Elige un audio (mp3/wav/m4a) o un v\xEDdeo con sonido (se extrae autom\xE1ticamente)",
|
|
978
|
+
"err.maxAudio": "M\xE1ximo {max} audios",
|
|
979
|
+
"err.audioLoad": "No se pudo cargar el audio, prueba con otro archivo",
|
|
980
|
+
"err.processFailed": "Error de procesamiento",
|
|
981
|
+
"err.posterFailed": "No se pudo renderizar la portada",
|
|
982
|
+
"err.canvas": "Canvas no disponible",
|
|
983
|
+
"err.imageRead": "No se pudo leer la imagen, prueba con otra",
|
|
984
|
+
"err.notImage": "Elige un archivo de imagen",
|
|
985
|
+
"err.fileType": "Solo se admiten archivos de imagen o v\xEDdeo",
|
|
986
|
+
"err.saveDrive": "No se pudo guardar en disco",
|
|
987
|
+
"msg.processing": "Exportando\u2026",
|
|
988
|
+
"msg.exportingHint": "Espera un momento. El resultado se devolver\xE1 autom\xE1ticamente al finalizar.",
|
|
989
|
+
"msg.done": "Listo \u2713",
|
|
990
|
+
"msg.loading": "Cargando medios\u2026",
|
|
991
|
+
"msg.exported": "Exportado: ",
|
|
992
|
+
"msg.saving": "Guardando\u2026",
|
|
993
|
+
"msg.saved": "Guardado en disco \u2713",
|
|
994
|
+
"lbl.ratioSection": "Proporci\xF3n de imagen (recorte, sin deformar)",
|
|
995
|
+
"lbl.dragToReposition": "\u2194 Arrastra la vista previa para reposicionar el recorte",
|
|
996
|
+
"lbl.sizeSection": "Tama\xF1o de exportaci\xF3n (px; recorte cover centrado si la proporci\xF3n difiere)",
|
|
997
|
+
"lbl.currentOut": "Salida",
|
|
998
|
+
"lbl.zoomSize": "Tama\xF1o",
|
|
999
|
+
"lbl.noScale": "(sin escala)",
|
|
1000
|
+
"lbl.coverNote": "\xB7 recorte centrado (cover) cuando la proporci\xF3n difiere, sin deformar",
|
|
1001
|
+
"lbl.audioTrackHint": "\u266A Pista de audio (\uFF0B a la derecha para a\xF1adir m\xFAsica, mezclada con el original)",
|
|
1002
|
+
"lbl.volume": "Volumen",
|
|
1003
|
+
"lbl.volNote": "(la vista previa limita a 100%, la exportaci\xF3n usa el valor definido)",
|
|
1004
|
+
"lbl.music": "M\xFAsica",
|
|
1005
|
+
"kbd.fit": "\u21E7 F",
|
|
1006
|
+
"poster.title": "Elegir portada",
|
|
1007
|
+
"panel.title": "Editor multimedia",
|
|
1008
|
+
"panel.subtitle": "Sube una imagen / v\xEDdeo \u2014 recorta \xB7 filtros \xB7 texto \xB7 exporta",
|
|
1009
|
+
"panel.pick": "Haz clic para elegir una imagen o v\xEDdeo",
|
|
1010
|
+
"panel.pickHint": "Im\xE1genes con Filerobot \xB7 v\xEDdeos: cortar/silenciar/portada"
|
|
1011
|
+
};
|
|
1012
|
+
var ZH_HANT_MAP = {
|
|
1013
|
+
\u7B80: "\u7C21",
|
|
1014
|
+
\u4F53: "\u9AD4",
|
|
1015
|
+
\u56FE: "\u5716",
|
|
1016
|
+
\u9891: "\u983B",
|
|
1017
|
+
\u89C6: "\u8996",
|
|
1018
|
+
\u8F91: "\u8F2F",
|
|
1019
|
+
\u8C03: "\u8ABF",
|
|
1020
|
+
\u6EE4: "\u6FFE",
|
|
1021
|
+
\u6807: "\u6A19",
|
|
1022
|
+
\u6CE8: "\u8A3B",
|
|
1023
|
+
\u8D34: "\u8CBC",
|
|
1024
|
+
\u9009: "\u9078",
|
|
1025
|
+
\u62E9: "\u64C7",
|
|
1026
|
+
\u7EBF: "\u7DDA",
|
|
1027
|
+
\u7BAD: "\u7BAD",
|
|
1028
|
+
\u5934: "\u982D",
|
|
1029
|
+
\u590D: "\u8907",
|
|
1030
|
+
\u5220: "\u522A",
|
|
1031
|
+
\u9664: "\u9664",
|
|
1032
|
+
\u7F16: "\u7DE8",
|
|
1033
|
+
\u8FB9: "\u908A",
|
|
1034
|
+
\u8F93: "\u8F38",
|
|
1035
|
+
\u5165: "\u5165",
|
|
1036
|
+
\u786E: "\u78BA",
|
|
1037
|
+
\u8BA4: "\u8A8D",
|
|
1038
|
+
\u9971: "\u98FD",
|
|
1039
|
+
\u5BF9: "\u5C0D",
|
|
1040
|
+
\u6696: "\u6696",
|
|
1041
|
+
\u9633: "\u967D",
|
|
1042
|
+
\u51B7: "\u51B7",
|
|
1043
|
+
\u7EB5: "\u7E31",
|
|
1044
|
+
\u6A2A: "\u6A6B",
|
|
1045
|
+
\u9002: "\u9069",
|
|
1046
|
+
\u5E94: "\u61C9",
|
|
1047
|
+
\u7F29: "\u7E2E",
|
|
1048
|
+
\u5B9E: "\u5BE6",
|
|
1049
|
+
\u9645: "\u969B",
|
|
1050
|
+
\u5BFC: "\u5C0E",
|
|
1051
|
+
\u51FA: "\u51FA",
|
|
1052
|
+
\u5C01: "\u5C01",
|
|
1053
|
+
\u9762: "\u9762",
|
|
1054
|
+
\u6362: "\u63DB",
|
|
1055
|
+
\u5F20: "\u5F35",
|
|
1056
|
+
\u9884: "\u9810",
|
|
1057
|
+
\u89C8: "\u89BD",
|
|
1058
|
+
\u52A8: "\u52D5",
|
|
1059
|
+
\u58F0: "\u8072",
|
|
1060
|
+
\u5F00: "\u958B",
|
|
1061
|
+
\u5173: "\u95DC",
|
|
1062
|
+
\u4E0E: "\u8207",
|
|
1063
|
+
\u4E50: "\u6A02",
|
|
1064
|
+
\u6DF7: "\u6DF7",
|
|
1065
|
+
\u5904: "\u8655",
|
|
1066
|
+
\u8F7D: "\u8F09",
|
|
1067
|
+
\u9519: "\u932F",
|
|
1068
|
+
\u8BEF: "\u8AA4",
|
|
1069
|
+
\u8BFB: "\u8B80",
|
|
1070
|
+
\u4EC5: "\u50C5",
|
|
1071
|
+
\u7EC8: "\u7D42",
|
|
1072
|
+
\u7A0D: "\u7A0D",
|
|
1073
|
+
\u5019: "\u5019",
|
|
1074
|
+
\u8FD4\u56DE: "\u8FD4\u56DE",
|
|
1075
|
+
\u5F53\u524D: "\u76EE\u524D",
|
|
1076
|
+
\u8F93\u51FA: "\u8F38\u51FA",
|
|
1077
|
+
\u753B: "\u756B",
|
|
1078
|
+
\u53D8: "\u8B8A",
|
|
1079
|
+
\u97F3\u9891: "\u97F3\u8A0A",
|
|
1080
|
+
\u97F3\u8F68: "\u97F3\u8ECC",
|
|
1081
|
+
\u6DFB\u52A0: "\u65B0\u589E",
|
|
1082
|
+
\u5220\u9664: "\u522A\u9664",
|
|
1083
|
+
\u4FDD\u5B58: "\u5132\u5B58",
|
|
1084
|
+
\u52A0\u8F7D: "\u8F09\u5165",
|
|
1085
|
+
\u7F51\u76D8: "\u7DB2\u76E4"
|
|
1086
|
+
};
|
|
1087
|
+
var toHant = (value) => {
|
|
1088
|
+
let next = value;
|
|
1089
|
+
for (const [from, to] of Object.entries(ZH_HANT_MAP).sort((a, b) => b[0].length - a[0].length)) {
|
|
1090
|
+
next = next.replaceAll(from, to);
|
|
1091
|
+
}
|
|
1092
|
+
return next;
|
|
1093
|
+
};
|
|
1094
|
+
var zhHant = Object.fromEntries(
|
|
1095
|
+
Object.entries(zh).map(([key, value]) => [key, toHant(value)])
|
|
1096
|
+
);
|
|
1097
|
+
var EDITOR_MESSAGES = { zh, en, es, "zh-Hant": zhHant };
|
|
1098
|
+
function tEditor(locale, key, vars) {
|
|
1099
|
+
let s = EDITOR_MESSAGES[locale]?.[key] ?? EDITOR_MESSAGES.zh[key] ?? key;
|
|
1100
|
+
if (vars) {
|
|
1101
|
+
for (const [k, v] of Object.entries(vars)) s = s.replaceAll(`{${k}}`, String(v));
|
|
1102
|
+
}
|
|
1103
|
+
return s;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
// src/platform-table.ts
|
|
1107
|
+
var DEFAULT_PLATFORM_TARGETS = [
|
|
1108
|
+
{ platform: "tiktok", postType: "video", label: "TikTok Video", shortLabel: "TT\xB7Video", ratio: "9:16", imageSize: "1440x2560", videoRatio: "9:16", videoResolution: "720p" },
|
|
1109
|
+
{ platform: "instagram", postType: "post", label: "Instagram Post", shortLabel: "IG\xB7Post", ratio: "1:1", imageSize: "2048x2048" },
|
|
1110
|
+
{ platform: "instagram", postType: "reels", label: "Instagram Reels", shortLabel: "IG\xB7Reels", ratio: "9:16", imageSize: "1440x2560", videoRatio: "9:16", videoResolution: "720p" },
|
|
1111
|
+
{ platform: "instagram", postType: "story", label: "Instagram Story", shortLabel: "IG\xB7Story", ratio: "9:16", imageSize: "1440x2560", videoRatio: "9:16", videoResolution: "720p" },
|
|
1112
|
+
{ platform: "facebook", postType: "post", label: "Facebook Post", shortLabel: "FB\xB7Post", ratio: "1:1", imageSize: "2048x2048" },
|
|
1113
|
+
{ platform: "facebook", postType: "reels", label: "Facebook Reels", shortLabel: "FB\xB7Reels", ratio: "9:16", imageSize: "1440x2560", videoRatio: "9:16", videoResolution: "720p" },
|
|
1114
|
+
{ platform: "youtube", postType: "video", label: "YouTube Video", shortLabel: "YT\xB7Video", ratio: "16:9", imageSize: "2560x1440", videoRatio: "16:9", videoResolution: "1080p" },
|
|
1115
|
+
{ platform: "youtube", postType: "shorts", label: "YouTube Shorts", shortLabel: "YT\xB7Shorts", ratio: "9:16", imageSize: "1440x2560", videoRatio: "9:16", videoResolution: "720p" },
|
|
1116
|
+
{ platform: "pinterest", postType: "pin", label: "Pinterest Pin", shortLabel: "PIN", ratio: "2:3", imageSize: "1664x2496", videoRatio: "9:16", videoResolution: "720p" },
|
|
1117
|
+
{ platform: "x", postType: "post", label: "X Post", shortLabel: "X\xB7Post", ratio: "16:9", imageSize: "2560x1440", videoRatio: "16:9", videoResolution: "720p" },
|
|
1118
|
+
{ platform: "linkedin", postType: "post", label: "LinkedIn Post", shortLabel: "LI\xB7Post", ratio: "1:1", imageSize: "2048x2048" },
|
|
1119
|
+
{ platform: "linkedin", postType: "video", label: "LinkedIn Video", shortLabel: "LI\xB7Video", ratio: "16:9", imageSize: "2560x1440", videoRatio: "16:9", videoResolution: "1080p" },
|
|
1120
|
+
{ platform: "threads", postType: "post", label: "Threads Post", shortLabel: "TH\xB7Post", ratio: "1:1", imageSize: "2048x2048" },
|
|
1121
|
+
{ platform: "telegram", postType: "post", label: "Telegram Post", shortLabel: "TG\xB7Post", ratio: "1:1", imageSize: "2048x2048", videoRatio: "9:16", videoResolution: "720p" },
|
|
1122
|
+
{ platform: "reddit", postType: "post", label: "Reddit Post", shortLabel: "RD\xB7Post", ratio: "16:9", imageSize: "2560x1440", videoRatio: "16:9", videoResolution: "720p" }
|
|
1123
|
+
];
|
|
1124
|
+
|
|
1125
|
+
// src/platform-presets.ts
|
|
1126
|
+
var RATIO_LABEL = {
|
|
1127
|
+
"1:1": "\u65B9\u5F62 1:1",
|
|
1128
|
+
"4:5": "\u7AD6\u56FE 4:5",
|
|
1129
|
+
"3:4": "\u7AD6\u56FE 3:4",
|
|
1130
|
+
"9:16": "\u7AD6\u5C4F 9:16",
|
|
1131
|
+
"16:9": "\u6A2A\u5C4F 16:9",
|
|
1132
|
+
"2:3": "\u7AD6\u56FE 2:3",
|
|
1133
|
+
"1.91:1": "\u6A2A\u5E45 1.91:1"
|
|
1134
|
+
};
|
|
1135
|
+
function parseRatio(r) {
|
|
1136
|
+
const [w, h] = r.split(":").map(Number);
|
|
1137
|
+
if (!w || !h) return 1;
|
|
1138
|
+
return w / h;
|
|
1139
|
+
}
|
|
1140
|
+
function dedupePresets(ratios) {
|
|
1141
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1142
|
+
const out = [];
|
|
1143
|
+
for (const r of ratios) {
|
|
1144
|
+
if (!r || seen.has(r)) continue;
|
|
1145
|
+
seen.add(r);
|
|
1146
|
+
out.push({ ratio: r, value: parseRatio(r), label: RATIO_LABEL[r] ?? r });
|
|
1147
|
+
}
|
|
1148
|
+
return out;
|
|
1149
|
+
}
|
|
1150
|
+
var IMAGE_RATIO_PRESETS = dedupePresets([
|
|
1151
|
+
"1:1",
|
|
1152
|
+
"4:5",
|
|
1153
|
+
"3:4",
|
|
1154
|
+
"2:3",
|
|
1155
|
+
"9:16",
|
|
1156
|
+
"16:9",
|
|
1157
|
+
"1.91:1"
|
|
1158
|
+
]);
|
|
1159
|
+
var VIDEO_RATIO_PRESETS = dedupePresets([
|
|
1160
|
+
"9:16",
|
|
1161
|
+
"16:9",
|
|
1162
|
+
"1:1",
|
|
1163
|
+
"4:5"
|
|
1164
|
+
]);
|
|
1165
|
+
function buildVideoPlatformRatioPresets(targets = DEFAULT_PLATFORM_TARGETS) {
|
|
1166
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1167
|
+
const out = [];
|
|
1168
|
+
for (const t of targets) {
|
|
1169
|
+
if (!t.videoRatio) continue;
|
|
1170
|
+
const key = `${t.platform}:${t.postType}:${t.videoRatio}`;
|
|
1171
|
+
if (seen.has(key)) continue;
|
|
1172
|
+
seen.add(key);
|
|
1173
|
+
const name = t.label.split(" ").slice(0, -1).join(" ") || t.label;
|
|
1174
|
+
out.push({ platform: t.platform, postType: t.postType, label: `${name} ${t.videoRatio}`, ratio: t.videoRatio, value: parseRatio(t.videoRatio) });
|
|
1175
|
+
}
|
|
1176
|
+
return out;
|
|
1177
|
+
}
|
|
1178
|
+
var VIDEO_PLATFORM_RATIO_PRESETS = buildVideoPlatformRatioPresets();
|
|
1179
|
+
function buildImagePlatformPresets(targets = DEFAULT_PLATFORM_TARGETS) {
|
|
1180
|
+
const byPlatform = /* @__PURE__ */ new Map();
|
|
1181
|
+
for (const t of targets) {
|
|
1182
|
+
const cur = byPlatform.get(t.platform);
|
|
1183
|
+
if (!cur || cur.postType !== "post" && t.postType === "post") byPlatform.set(t.platform, t);
|
|
1184
|
+
}
|
|
1185
|
+
return Array.from(byPlatform.values()).map((t) => {
|
|
1186
|
+
const [w, h] = t.imageSize.split("x").map(Number);
|
|
1187
|
+
const name = t.label.split(" ").slice(0, -1).join(" ") || t.label;
|
|
1188
|
+
return { platform: t.platform, label: `${name} ${t.ratio}`, ratio: t.ratio, value: parseRatio(t.ratio), w, h };
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
var IMAGE_PLATFORM_PRESETS = buildImagePlatformPresets();
|
|
1192
|
+
function sizeOf(ratioValue, shortSide) {
|
|
1193
|
+
if (ratioValue >= 1) {
|
|
1194
|
+
return { w: Math.round(shortSide * ratioValue / 2) * 2, h: shortSide };
|
|
1195
|
+
}
|
|
1196
|
+
return { w: shortSide, h: Math.round(shortSide / ratioValue / 2) * 2 };
|
|
1197
|
+
}
|
|
1198
|
+
function buildVideoSizePresets(targets = DEFAULT_PLATFORM_TARGETS) {
|
|
1199
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1200
|
+
const out = [];
|
|
1201
|
+
for (const t of targets) {
|
|
1202
|
+
if (!t.videoRatio || !t.videoResolution) continue;
|
|
1203
|
+
const shortSide = t.videoResolution === "1080p" ? 1080 : 720;
|
|
1204
|
+
const { w, h } = sizeOf(parseRatio(t.videoRatio), shortSide);
|
|
1205
|
+
const key = `${w}x${h}`;
|
|
1206
|
+
if (seen.has(key)) continue;
|
|
1207
|
+
seen.add(key);
|
|
1208
|
+
out.push({ label: `${t.shortLabel} ${w}\xD7${h}`, w, h });
|
|
1209
|
+
}
|
|
1210
|
+
return out;
|
|
1211
|
+
}
|
|
1212
|
+
var VIDEO_SIZE_PRESETS = buildVideoSizePresets();
|
|
1213
|
+
|
|
1214
|
+
// src/filerobot-annotation.ts
|
|
1215
|
+
function compensateAnnotationRotation(ann, state) {
|
|
1216
|
+
if (ann.isDuplicated) return {};
|
|
1217
|
+
if ((ann.rotation ?? 0) !== 0) return {};
|
|
1218
|
+
const rot = state.adjustments?.rotation ?? 0;
|
|
1219
|
+
return rot ? { rotation: -rot } : {};
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
exports.AudioClip = AudioClip;
|
|
1223
|
+
exports.Clip = Clip;
|
|
1224
|
+
exports.DEFAULT_PLATFORM_TARGETS = DEFAULT_PLATFORM_TARGETS;
|
|
1225
|
+
exports.DEG2RAD = DEG2RAD;
|
|
1226
|
+
exports.EDITOR_MESSAGES = EDITOR_MESSAGES;
|
|
1227
|
+
exports.FILTER_PRESETS = FILTER_PRESETS;
|
|
1228
|
+
exports.IMAGE_PLATFORM_PRESETS = IMAGE_PLATFORM_PRESETS;
|
|
1229
|
+
exports.IMAGE_RATIO_PRESETS = IMAGE_RATIO_PRESETS;
|
|
1230
|
+
exports.MIN_CLIP = MIN_CLIP;
|
|
1231
|
+
exports.Overlay = Overlay;
|
|
1232
|
+
exports.VIDEO_PLATFORM_RATIO_PRESETS = VIDEO_PLATFORM_RATIO_PRESETS;
|
|
1233
|
+
exports.VIDEO_RATIO_PRESETS = VIDEO_RATIO_PRESETS;
|
|
1234
|
+
exports.VIDEO_SIZE_PRESETS = VIDEO_SIZE_PRESETS;
|
|
1235
|
+
exports.VideoEditState = VideoEditState;
|
|
1236
|
+
exports.buildFfmpegArgs = buildFfmpegArgs;
|
|
1237
|
+
exports.buildFilterCss = buildFilterCss;
|
|
1238
|
+
exports.buildImagePlatformPresets = buildImagePlatformPresets;
|
|
1239
|
+
exports.buildPosterArgs = buildPosterArgs;
|
|
1240
|
+
exports.buildVideoPlatformRatioPresets = buildVideoPlatformRatioPresets;
|
|
1241
|
+
exports.buildVideoSizePresets = buildVideoSizePresets;
|
|
1242
|
+
exports.canRedo = canRedo;
|
|
1243
|
+
exports.canUndo = canUndo;
|
|
1244
|
+
exports.centeredMaxRect = centeredMaxRect;
|
|
1245
|
+
exports.clampAudioClip = clampAudioClip;
|
|
1246
|
+
exports.clampRect = clampRect;
|
|
1247
|
+
exports.clipDuration = clipDuration;
|
|
1248
|
+
exports.clipStartsAt = clipStartsAt;
|
|
1249
|
+
exports.compensateAnnotationRotation = compensateAnnotationRotation;
|
|
1250
|
+
exports.contentDuration = contentDuration;
|
|
1251
|
+
exports.createHistory = createHistory;
|
|
1252
|
+
exports.defaultVideoEditState = defaultVideoEditState;
|
|
1253
|
+
exports.duplicateClip = duplicateClip;
|
|
1254
|
+
exports.evenize = evenize;
|
|
1255
|
+
exports.findFilterPreset = findFilterPreset;
|
|
1256
|
+
exports.fitRects = fitRects;
|
|
1257
|
+
exports.locateOutput = locateOutput;
|
|
1258
|
+
exports.normalizeDeg = normalizeDeg;
|
|
1259
|
+
exports.outputSize = outputSize;
|
|
1260
|
+
exports.parseRatio = parseRatio;
|
|
1261
|
+
exports.pushHistory = pushHistory;
|
|
1262
|
+
exports.redo = redo;
|
|
1263
|
+
exports.remapSrcIndices = remapSrcIndices;
|
|
1264
|
+
exports.removeClip = removeClip;
|
|
1265
|
+
exports.reorderClips = reorderClips;
|
|
1266
|
+
exports.replacePresent = replacePresent;
|
|
1267
|
+
exports.rotatedSize = rotatedSize;
|
|
1268
|
+
exports.splitAtOutput = splitAtOutput;
|
|
1269
|
+
exports.tEditor = tEditor;
|
|
1270
|
+
exports.toHant = toHant;
|
|
1271
|
+
exports.totalDuration = totalDuration;
|
|
1272
|
+
exports.trimClipEdge = trimClipEdge;
|
|
1273
|
+
exports.undo = undo;
|
|
1274
|
+
exports.usedVideoSrcIndices = usedVideoSrcIndices;
|
|
1275
|
+
//# sourceMappingURL=index.cjs.map
|
|
1276
|
+
//# sourceMappingURL=index.cjs.map
|