@openrails/contentkit-ui 0.0.0-placeholder → 0.68.0
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/README.md +424 -1
- package/dist/appearance.d.ts +38 -0
- package/dist/appearance.js +15 -0
- package/dist/appearance.js.map +1 -0
- package/dist/assets/hash.worker-BYfo-7MQ.js.map +1 -0
- package/dist/client/aspect.d.ts +6 -0
- package/dist/client/aspect.js +17 -0
- package/dist/client/aspect.js.map +1 -0
- package/dist/client/client.d.ts +51 -0
- package/dist/client/client.js +35 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/codes.d.ts +12 -0
- package/dist/client/codes.js +19 -0
- package/dist/client/codes.js.map +1 -0
- package/dist/client/content/bans.d.ts +15 -0
- package/dist/client/content/bans.js +40 -0
- package/dist/client/content/bans.js.map +1 -0
- package/dist/client/content/comments.d.ts +36 -0
- package/dist/client/content/comments.js +93 -0
- package/dist/client/content/comments.js.map +1 -0
- package/dist/client/content/favorites.d.ts +14 -0
- package/dist/client/content/favorites.js +42 -0
- package/dist/client/content/favorites.js.map +1 -0
- package/dist/client/content/moderation.d.ts +18 -0
- package/dist/client/content/moderation.js +37 -0
- package/dist/client/content/moderation.js.map +1 -0
- package/dist/client/content/polls.d.ts +47 -0
- package/dist/client/content/polls.js +148 -0
- package/dist/client/content/polls.js.map +1 -0
- package/dist/client/content/posts.d.ts +44 -0
- package/dist/client/content/posts.js +91 -0
- package/dist/client/content/posts.js.map +1 -0
- package/dist/client/content/reactions.d.ts +12 -0
- package/dist/client/content/reactions.js +36 -0
- package/dist/client/content/reactions.js.map +1 -0
- package/dist/client/content/types.d.ts +91 -0
- package/dist/client/content/types.js +8 -0
- package/dist/client/content/types.js.map +1 -0
- package/dist/client/crop.d.ts +32 -0
- package/dist/client/crop.js +103 -0
- package/dist/client/crop.js.map +1 -0
- package/dist/client/errors.d.ts +54 -0
- package/dist/client/errors.js +80 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/gallery.d.ts +43 -0
- package/dist/client/gallery.js +86 -0
- package/dist/client/gallery.js.map +1 -0
- package/dist/client/generated/error-codes.d.ts +5 -0
- package/dist/client/generated/error-codes.js +131 -0
- package/dist/client/generated/error-codes.js.map +1 -0
- package/dist/client/generated/routes.d.ts +1086 -0
- package/dist/client/generated/routes.js +1400 -0
- package/dist/client/generated/routes.js.map +1 -0
- package/dist/client/generated/wire.d.ts +630 -0
- package/dist/client/generated/wire.js +6 -0
- package/dist/client/generated/wire.js.map +1 -0
- package/dist/client/http.d.ts +79 -0
- package/dist/client/http.js +74 -0
- package/dist/client/http.js.map +1 -0
- package/dist/client/image.d.ts +24 -0
- package/dist/client/image.js +65 -0
- package/dist/client/image.js.map +1 -0
- package/dist/client/index.d.ts +33 -0
- package/dist/client/media/api.d.ts +36 -0
- package/dist/client/media/api.js +61 -0
- package/dist/client/media/api.js.map +1 -0
- package/dist/client/media/client.d.ts +247 -0
- package/dist/client/media/client.js +407 -0
- package/dist/client/media/client.js.map +1 -0
- package/dist/client/media/encode.d.ts +3 -0
- package/dist/client/media/encode.js +8 -0
- package/dist/client/media/encode.js.map +1 -0
- package/dist/client/media/hash-stream.d.ts +6 -0
- package/dist/client/media/hash-stream.js +16 -0
- package/dist/client/media/hash-stream.js.map +1 -0
- package/dist/client/media/hash.d.ts +12 -0
- package/dist/client/media/hash.js +48 -0
- package/dist/client/media/hash.js.map +1 -0
- package/dist/client/media/hash.worker-inline.js +18 -0
- package/dist/client/media/hash.worker-inline.js.map +1 -0
- package/dist/client/media/pacer.d.ts +21 -0
- package/dist/client/media/pacer.js +25 -0
- package/dist/client/media/pacer.js.map +1 -0
- package/dist/client/media/queue.d.ts +112 -0
- package/dist/client/media/queue.js +274 -0
- package/dist/client/media/queue.js.map +1 -0
- package/dist/client/media/ref.d.ts +6 -0
- package/dist/client/media/ref.js +10 -0
- package/dist/client/media/ref.js.map +1 -0
- package/dist/client/media/rules.d.ts +52 -0
- package/dist/client/media/rules.js +139 -0
- package/dist/client/media/rules.js.map +1 -0
- package/dist/client/media/transport.d.ts +13 -0
- package/dist/client/media/transport.js +33 -0
- package/dist/client/media/transport.js.map +1 -0
- package/dist/client/media/windows.d.ts +15 -0
- package/dist/client/media/windows.js +39 -0
- package/dist/client/media/windows.js.map +1 -0
- package/dist/client/playback.d.ts +200 -0
- package/dist/client/playback.js +142 -0
- package/dist/client/playback.js.map +1 -0
- package/dist/client/player.d.ts +102 -0
- package/dist/client/player.js +155 -0
- package/dist/client/player.js.map +1 -0
- package/dist/client/public.d.ts +25 -0
- package/dist/client/public.js +18 -0
- package/dist/client/public.js.map +1 -0
- package/dist/client/rendition.d.ts +19 -0
- package/dist/client/rendition.js +16 -0
- package/dist/client/rendition.js.map +1 -0
- package/dist/client/route.d.ts +39 -0
- package/dist/client/route.js +31 -0
- package/dist/client/route.js.map +1 -0
- package/dist/client/taxonomy.d.ts +30 -0
- package/dist/client/taxonomy.js +77 -0
- package/dist/client/taxonomy.js.map +1 -0
- package/dist/client.js +33 -0
- package/dist/components/encode-progress.d.ts +15 -0
- package/dist/components/encode-progress.js +49 -0
- package/dist/components/encode-progress.js.map +1 -0
- package/dist/components/hover-preview.d.ts +29 -0
- package/dist/components/hover-preview.js +49 -0
- package/dist/components/hover-preview.js.map +1 -0
- package/dist/components/image-crop-dialog.d.ts +48 -0
- package/dist/components/image-crop-dialog.js +359 -0
- package/dist/components/image-crop-dialog.js.map +1 -0
- package/dist/components/lazy-mount.d.ts +10 -0
- package/dist/components/lazy-mount.js +22 -0
- package/dist/components/lazy-mount.js.map +1 -0
- package/dist/components/media-folder-editor.d.ts +45 -0
- package/dist/components/media-folder-editor.js +564 -0
- package/dist/components/media-folder-editor.js.map +1 -0
- package/dist/components/media-gallery.d.ts +54 -0
- package/dist/components/media-gallery.js +597 -0
- package/dist/components/media-gallery.js.map +1 -0
- package/dist/components/media-readiness-notice.d.ts +24 -0
- package/dist/components/media-readiness-notice.js +61 -0
- package/dist/components/media-readiness-notice.js.map +1 -0
- package/dist/components/player-controls.d.ts +71 -0
- package/dist/components/player-controls.js +264 -0
- package/dist/components/player-controls.js.map +1 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.js +14 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/rendition-img.d.ts +34 -0
- package/dist/components/rendition-img.js +78 -0
- package/dist/components/rendition-img.js.map +1 -0
- package/dist/components/slot-editor.d.ts +95 -0
- package/dist/components/slot-editor.js +182 -0
- package/dist/components/slot-editor.js.map +1 -0
- package/dist/components/slot-image.d.ts +23 -0
- package/dist/components/slot-image.js +48 -0
- package/dist/components/slot-image.js.map +1 -0
- package/dist/components/slot-upload.d.ts +41 -0
- package/dist/components/slot-upload.js +213 -0
- package/dist/components/slot-upload.js.map +1 -0
- package/dist/components/social/bans.d.ts +42 -0
- package/dist/components/social/bans.js +300 -0
- package/dist/components/social/bans.js.map +1 -0
- package/dist/components/social/comments.d.ts +42 -0
- package/dist/components/social/comments.js +517 -0
- package/dist/components/social/comments.js.map +1 -0
- package/dist/components/social/engagement.d.ts +45 -0
- package/dist/components/social/engagement.js +129 -0
- package/dist/components/social/engagement.js.map +1 -0
- package/dist/components/social/index.d.ts +6 -0
- package/dist/components/social/moderation.d.ts +32 -0
- package/dist/components/social/moderation.js +383 -0
- package/dist/components/social/moderation.js.map +1 -0
- package/dist/components/social/parts.d.ts +50 -0
- package/dist/components/social/parts.js +106 -0
- package/dist/components/social/parts.js.map +1 -0
- package/dist/components/social/poll-editor.d.ts +34 -0
- package/dist/components/social/poll-editor.js +567 -0
- package/dist/components/social/poll-editor.js.map +1 -0
- package/dist/components/social/poll.d.ts +30 -0
- package/dist/components/social/poll.js +252 -0
- package/dist/components/social/poll.js.map +1 -0
- package/dist/components/sortable-list.d.ts +29 -0
- package/dist/components/sortable-list.js +121 -0
- package/dist/components/sortable-list.js.map +1 -0
- package/dist/components/video-mini-player.d.ts +35 -0
- package/dist/components/video-mini-player.js +236 -0
- package/dist/components/video-mini-player.js.map +1 -0
- package/dist/components/video-player.d.ts +146 -0
- package/dist/components/video-player.js +630 -0
- package/dist/components/video-player.js.map +1 -0
- package/dist/components/video-poster-picker.d.ts +59 -0
- package/dist/components/video-poster-picker.js +335 -0
- package/dist/components/video-poster-picker.js.map +1 -0
- package/dist/components/video-poster.d.ts +24 -0
- package/dist/components/video-poster.js +46 -0
- package/dist/components/video-poster.js.map +1 -0
- package/dist/i18n/context.d.ts +4 -0
- package/dist/i18n/context.js +11 -0
- package/dist/i18n/context.js.map +1 -0
- package/dist/i18n/messages.d.ts +40 -0
- package/dist/i18n/messages.js +94 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +41 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +271 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.d.ts +457 -0
- package/dist/locales/en.js +271 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/es.js +271 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/ja.d.ts +2 -0
- package/dist/locales/ja.js +271 -0
- package/dist/locales/ja.js.map +1 -0
- package/dist/locales/ko.d.ts +2 -0
- package/dist/locales/ko.js +271 -0
- package/dist/locales/ko.js.map +1 -0
- package/dist/locales/social/de.d.ts +2 -0
- package/dist/locales/social/de.js +198 -0
- package/dist/locales/social/de.js.map +1 -0
- package/dist/locales/social/en.d.ts +195 -0
- package/dist/locales/social/en.js +198 -0
- package/dist/locales/social/en.js.map +1 -0
- package/dist/locales/social/es.d.ts +2 -0
- package/dist/locales/social/es.js +198 -0
- package/dist/locales/social/es.js.map +1 -0
- package/dist/locales/social/ja.d.ts +2 -0
- package/dist/locales/social/ja.js +198 -0
- package/dist/locales/social/ja.js.map +1 -0
- package/dist/locales/social/ko.d.ts +2 -0
- package/dist/locales/social/ko.js +198 -0
- package/dist/locales/social/ko.js.map +1 -0
- package/dist/locales/social/zh.d.ts +2 -0
- package/dist/locales/social/zh.js +198 -0
- package/dist/locales/social/zh.js.map +1 -0
- package/dist/locales/zh.d.ts +2 -0
- package/dist/locales/zh.js +271 -0
- package/dist/locales/zh.js.map +1 -0
- package/dist/provider.d.ts +22 -0
- package/dist/provider.js +59 -0
- package/dist/provider.js.map +1 -0
- package/dist/react/canonical.d.ts +33 -0
- package/dist/react/canonical.js +88 -0
- package/dist/react/canonical.js.map +1 -0
- package/dist/react/comments.d.ts +82 -0
- package/dist/react/comments.js +147 -0
- package/dist/react/comments.js.map +1 -0
- package/dist/react/config.d.ts +13 -0
- package/dist/react/config.js +14 -0
- package/dist/react/config.js.map +1 -0
- package/dist/react/context.d.ts +48 -0
- package/dist/react/context.js +37 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/crop.d.ts +49 -0
- package/dist/react/crop.js +107 -0
- package/dist/react/crop.js.map +1 -0
- package/dist/react/engagement.d.ts +38 -0
- package/dist/react/engagement.js +88 -0
- package/dist/react/engagement.js.map +1 -0
- package/dist/react/folder.d.ts +83 -0
- package/dist/react/folder.js +183 -0
- package/dist/react/folder.js.map +1 -0
- package/dist/react/gallery.d.ts +140 -0
- package/dist/react/gallery.js +477 -0
- package/dist/react/gallery.js.map +1 -0
- package/dist/react/index.d.ts +21 -0
- package/dist/react/inline-preview.d.ts +24 -0
- package/dist/react/inline-preview.js +76 -0
- package/dist/react/inline-preview.js.map +1 -0
- package/dist/react/player.d.ts +70 -0
- package/dist/react/player.js +214 -0
- package/dist/react/player.js.map +1 -0
- package/dist/react/polls.d.ts +74 -0
- package/dist/react/polls.js +176 -0
- package/dist/react/polls.js.map +1 -0
- package/dist/react/posts.d.ts +59 -0
- package/dist/react/posts.js +149 -0
- package/dist/react/posts.js.map +1 -0
- package/dist/react/provider.d.ts +23 -0
- package/dist/react/provider.js +35 -0
- package/dist/react/provider.js.map +1 -0
- package/dist/react/public.d.ts +39 -0
- package/dist/react/public.js +70 -0
- package/dist/react/public.js.map +1 -0
- package/dist/react/read.d.ts +52 -0
- package/dist/react/read.js +143 -0
- package/dist/react/read.js.map +1 -0
- package/dist/react/resources.d.ts +70 -0
- package/dist/react/resources.js +247 -0
- package/dist/react/resources.js.map +1 -0
- package/dist/react/slot.d.ts +102 -0
- package/dist/react/slot.js +181 -0
- package/dist/react/slot.js.map +1 -0
- package/dist/react/store.d.ts +51 -0
- package/dist/react/store.js +164 -0
- package/dist/react/store.js.map +1 -0
- package/dist/react/upload.d.ts +85 -0
- package/dist/react/upload.js +150 -0
- package/dist/react/upload.js.map +1 -0
- package/dist/react/use-resource.d.ts +43 -0
- package/dist/react/use-resource.js +66 -0
- package/dist/react/use-resource.js.map +1 -0
- package/dist/react/video.d.ts +118 -0
- package/dist/react/video.js +184 -0
- package/dist/react/video.js.map +1 -0
- package/dist/react/viewport.d.ts +19 -0
- package/dist/react/viewport.js +30 -0
- package/dist/react/viewport.js.map +1 -0
- package/dist/react.js +21 -0
- package/dist/scope.d.ts +14 -0
- package/dist/scope.js +30 -0
- package/dist/scope.js.map +1 -0
- package/dist/styles.css +3 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +86 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.js +38 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/avatar.d.ts +11 -0
- package/dist/ui/avatar.js +31 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +7 -0
- package/dist/ui/badge.js +31 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +8 -0
- package/dist/ui/button.js +46 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.js +91 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +15 -0
- package/dist/ui/dropdown-menu.js +105 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +17 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +15 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/progress.d.ts +7 -0
- package/dist/ui/progress.js +31 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +98 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +14 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +3 -0
- package/dist/ui/slider.js +35 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.js +20 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/tabs.d.ts +10 -0
- package/dist/ui/tabs.js +47 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +15 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +5 -0
- package/dist/ui/toggle-group.js +23 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/urls/index.d.ts +100 -0
- package/dist/urls.js +118 -0
- package/dist/urls.js.map +1 -0
- package/package.json +113 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-poster.js","names":[],"sources":["../../src/components/video-poster.tsx"],"sourcesContent":["import { ratio, type AspectRatio } from \"../client/aspect.js\";\nimport { Video01Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { cn } from \"cn\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { publicRenditions, type PublicPreset } from \"../client/public.js\";\nimport type { DensityRange } from \"../client/rendition.js\";\nimport { RenditionImg } from \"./rendition-img.js\";\nimport { ContentKitUiRoot } from \"../scope.js\";\n\nexport interface VideoPosterProps extends Omit<ComponentProps<\"div\">, \"children\"> {\n /** The poster's public preset (its aspect is the video's), or an image URL. */\n poster?: PublicPreset | string | null;\n /** The box's \"W:H\"; default the preset's aspect, else \"16:9\". */\n aspect?: AspectRatio;\n /** Density range for picking the poster's width; default the provider's (2–3×). */\n density?: DensityRange;\n alt?: string;\n /** Shown without a poster (or when it fails to load); default a muted box with a video icon. */\n fallback?: ReactNode;\n /** Overlays (duration, badges). */\n children?: ReactNode;\n}\n\n/**\n * A poster at its aspect, uncropped, spanning its container's width, at the\n * width its rendered width × density needs. It never plays: use it for\n * videos the viewer cannot play (a locked post); playable ones\n * preview inline in VideoPlayer and MediaGallery.\n */\nexport function VideoPoster({ poster, aspect, density, alt = \"\", fallback, className, style, children, ...div }: VideoPosterProps) {\n const preset = typeof poster === \"string\" ? null : poster;\n const outputs = publicRenditions(preset);\n const shape = aspect ?? (preset?.aspect || \"16:9\");\n const img = \"absolute inset-0 size-full object-contain\";\n const empty = fallback ?? (\n <div className=\"absolute inset-0 flex items-center justify-center text-muted-foreground/70\">\n <HugeiconsIcon icon={Video01Icon} strokeWidth={1.5} className=\"size-10\" />\n </div>\n );\n return (\n <ContentKitUiRoot\n {...div}\n className={cn(\"relative w-full overflow-hidden rounded-lg bg-muted\", className)}\n style={{ aspectRatio: String(ratio(shape) ?? 16 / 9), ...style }}\n data-ckui=\"video-poster\"\n >\n {typeof poster === \"string\" ? (\n <img src={poster} alt={alt} loading=\"lazy\" decoding=\"async\" className={img} />\n ) : outputs.length ? (\n <RenditionImg outputs={outputs} density={density} alt={alt} loading=\"lazy\" className={img} fallback={empty} />\n ) : (\n empty\n )}\n {children}\n </ContentKitUiRoot>\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,SAAgB,EAAY,EAAE,WAAQ,WAAQ,YAAS,SAAM,IAAI,aAAU,cAAW,UAAO,aAAU,GAAG,KAAyB;CACjI,IAAM,IAAS,OAAO,KAAW,WAAW,OAAO,GAC7C,IAAU,EAAiB,CAAM,GACjC,IAAQ,MAAW,GAAQ,UAAU,SACrC,IAAM,6CACN,IAAQ,KACZ,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,GAAD;GAAe,MAAM;GAAa,aAAa;GAAK,WAAU;EAAW,CAAA;CACtE,CAAA;CAEP,OACE,kBAAC,GAAD;EACE,GAAI;EACJ,WAAW,EAAG,uDAAuD,CAAS;EAC9E,OAAO;GAAE,aAAa,OAAO,EAAM,CAAK,KAAK,KAAK,CAAC;GAAG,GAAG;EAAM;EAC/D,aAAU;EAJZ,UAAA,CAMG,OAAO,KAAW,WACjB,kBAAC,OAAD;GAAK,KAAK;GAAa;GAAK,SAAQ;GAAO,UAAS;GAAQ,WAAW;EAAM,CAAA,IAC3E,EAAQ,SACV,kBAAC,GAAD;GAAuB;GAAkB;GAAc;GAAK,SAAQ;GAAO,WAAW;GAAK,UAAU;EAAQ,CAAA,IAE7G,GAED,CACe;;AAEtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createTranslator as e, defaultMessages as t } from "./messages.js";
|
|
2
|
+
import { createContext as n, useContext as r } from "react";
|
|
3
|
+
//#region src/i18n/context.ts
|
|
4
|
+
var i = n(e(t));
|
|
5
|
+
function a() {
|
|
6
|
+
return r(i);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { i as MessagesContext, a as useMessages };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../src/i18n/context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { createTranslator, defaultMessages, type Translator } from \"./messages.js\";\n\nexport const MessagesContext = createContext<Translator>(createTranslator(defaultMessages));\n\n/** English defaults when rendered outside a `ContentKitUiProvider`. */\nexport function useMessages(): Translator {\n return useContext(MessagesContext);\n}\n"],"mappings":";;;AAGA,IAAa,IAAkB,EAA0B,EAAiB,CAAe,CAAC;AAG1F,SAAgB,IAA0B;CACxC,OAAO,EAAW,CAAe;AACnC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { en } from '../locales/en.js';
|
|
2
|
+
type Widen<T> = {
|
|
3
|
+
[K in keyof T]: T[K] extends string ? string : Widen<T[K]>;
|
|
4
|
+
};
|
|
5
|
+
type DeepPartial<T> = {
|
|
6
|
+
[K in keyof T]?: T[K] extends string ? string : DeepPartial<T[K]>;
|
|
7
|
+
};
|
|
8
|
+
type Paths<T, P extends string = ""> = {
|
|
9
|
+
[K in keyof T & string]: T[K] extends string ? `${P}${K}` : Paths<T[K], `${P}${K}.`>;
|
|
10
|
+
}[keyof T & string];
|
|
11
|
+
/** The complete message tree; English is the reference shape. */
|
|
12
|
+
export type ContentKitUiMessages = Widen<typeof en>;
|
|
13
|
+
/** A locale bundle or host override: any subset of the tree. */
|
|
14
|
+
export type ContentKitUiMessageBundle = DeepPartial<ContentKitUiMessages>;
|
|
15
|
+
/** Dotted key of any message, e.g. `crop.title`. */
|
|
16
|
+
export type MessageKey = Paths<ContentKitUiMessages>;
|
|
17
|
+
export type MessageVars = Record<string, string | number>;
|
|
18
|
+
/** Host translation hook; return nothing (or the key) to use ours. */
|
|
19
|
+
export type ContentKitUiTranslate = (key: string, vars?: MessageVars) => string | null | undefined;
|
|
20
|
+
export declare const defaultMessages: ContentKitUiMessages;
|
|
21
|
+
export declare function defineMessages(bundle: ContentKitUiMessageBundle): ContentKitUiMessageBundle;
|
|
22
|
+
/** Layers bundles over English; later bundles win, missing keys fall back. */
|
|
23
|
+
export declare function resolveMessages(bundles?: ContentKitUiMessageBundle | readonly ContentKitUiMessageBundle[]): ContentKitUiMessages;
|
|
24
|
+
export declare function interpolate(template: string, vars?: MessageVars): string;
|
|
25
|
+
export interface Translator {
|
|
26
|
+
messages: ContentKitUiMessages;
|
|
27
|
+
/** The UI's BCP 47 language (dates, plurals); undefined: the browser's. */
|
|
28
|
+
language?: string;
|
|
29
|
+
t(key: MessageKey, vars?: MessageVars): string;
|
|
30
|
+
/** key_one or key_other by count (as the language's plural rules pick), with {count}. */
|
|
31
|
+
plural(key: string, count: number, vars?: MessageVars): string;
|
|
32
|
+
/** Message for a ContentKitError (or its code). */
|
|
33
|
+
error(error: unknown): string;
|
|
34
|
+
}
|
|
35
|
+
export declare function createTranslator(messages: ContentKitUiMessages, hostT?: ContentKitUiTranslate, language?: string): Translator;
|
|
36
|
+
/** "image/avif" → "AVIF". */
|
|
37
|
+
export declare function formatName(type?: string): string;
|
|
38
|
+
/** A byte size as the messages state it: "2.5 MB", "25 MB", "20 GB". */
|
|
39
|
+
export declare function megabytes(n: number): string;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { en as e } from "../locales/en.js";
|
|
2
|
+
import { ratioLabel as t } from "../client/media/rules.js";
|
|
3
|
+
//#region src/i18n/messages.ts
|
|
4
|
+
var n = e;
|
|
5
|
+
function r(e) {
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
function i(e, t) {
|
|
9
|
+
let n = { ...e };
|
|
10
|
+
for (let [e, r] of Object.entries(t)) {
|
|
11
|
+
if (r == null) continue;
|
|
12
|
+
let t = n[e];
|
|
13
|
+
typeof r == "string" ? r !== "" && (n[e] = r) : n[e] = i(typeof t == "object" ? t : {}, r);
|
|
14
|
+
}
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function a(t) {
|
|
18
|
+
let n = t ? Array.isArray(t) ? t : [t] : [], r = e;
|
|
19
|
+
for (let e of n) r = i(r, e);
|
|
20
|
+
return r;
|
|
21
|
+
}
|
|
22
|
+
function o(e, t) {
|
|
23
|
+
return t ? e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e) : e;
|
|
24
|
+
}
|
|
25
|
+
function s(e, t) {
|
|
26
|
+
let n = e;
|
|
27
|
+
for (let e of t.split(".")) {
|
|
28
|
+
if (!n || typeof n != "object") return;
|
|
29
|
+
n = n[e];
|
|
30
|
+
}
|
|
31
|
+
return typeof n == "string" ? n : void 0;
|
|
32
|
+
}
|
|
33
|
+
function c(e, n, r) {
|
|
34
|
+
let i = (t, r) => {
|
|
35
|
+
let i = n?.(t, r);
|
|
36
|
+
if (i && i !== t) return i;
|
|
37
|
+
let a = s(e, t);
|
|
38
|
+
return a === void 0 ? void 0 : o(a, r);
|
|
39
|
+
}, a;
|
|
40
|
+
return {
|
|
41
|
+
messages: e,
|
|
42
|
+
language: r,
|
|
43
|
+
t: (e, t) => i(e, t) ?? e,
|
|
44
|
+
plural(e, t, n) {
|
|
45
|
+
a ??= new Intl.PluralRules(r);
|
|
46
|
+
let o = {
|
|
47
|
+
...n,
|
|
48
|
+
count: t
|
|
49
|
+
};
|
|
50
|
+
return i(`${e}_${a.select(t)}`, o) ?? i(`${e}_other`, o) ?? e;
|
|
51
|
+
},
|
|
52
|
+
error(n) {
|
|
53
|
+
if (typeof n == "string") return i(`errors.${n}`, { seconds: 60 }) ?? e.errors.generic;
|
|
54
|
+
let r = n ?? {}, a = typeof r.code == "string" ? r.code : void 0, o = typeof r.message == "string" && r.message ? d(r.message) : void 0, s = r.details ?? {}, c = {
|
|
55
|
+
seconds: r.retryAfter ?? 60,
|
|
56
|
+
width: s.width ?? "",
|
|
57
|
+
height: s.height ?? "",
|
|
58
|
+
min: s.min_width ?? "",
|
|
59
|
+
megapixels: s.max_pixels ? Math.round(s.max_pixels / 1e6) : "",
|
|
60
|
+
format: l(s.type),
|
|
61
|
+
allowed: (s.allowed ?? []).map(l).join(", "),
|
|
62
|
+
size: s.size ? u(s.size) : "",
|
|
63
|
+
max: s.max_bytes ? u(s.max_bytes) : "",
|
|
64
|
+
frames: s.frames ?? "",
|
|
65
|
+
maxFrames: s.max_frames ?? "",
|
|
66
|
+
maxSeconds: s.max_seconds ?? "",
|
|
67
|
+
duration: s.seconds ?? "",
|
|
68
|
+
shape: s.width && s.height ? t(s.width / s.height) : "",
|
|
69
|
+
minAspect: s.min_aspect ? t(s.min_aspect) : "",
|
|
70
|
+
maxAspect: s.max_aspect ? t(s.max_aspect) : "",
|
|
71
|
+
maxFiles: s.max ?? "",
|
|
72
|
+
maxChars: s.max ?? ""
|
|
73
|
+
};
|
|
74
|
+
return a === "invalid_request" && o ? o : a === "type_not_allowed" && s.allowed?.length ? `${i("errors.type_not_allowed", c)} ${i("errors.allowedTypes", c)}` : a === "comment_too_long" && s.max ? i("errors.commentTooLongBy", c) ?? e.errors.comment_too_long : a === "too_large" && s.max_bytes ? i("errors.tooLargeBy", c) ?? e.errors.too_large : a === "image_too_large" && (s.frames ?? 0) > 1 ? i("errors.animationTooLarge", c) ?? e.errors.image_too_large : a === "animation_too_long" && (s.max_frames || s.max_seconds) ? i(s.max_frames ? "errors.animationFrames" : "errors.animationSeconds", c) ?? e.errors.generic : a === "video_too_long" && s.max_seconds ? i("errors.videoTooLongBy", c) ?? e.errors.video_too_long : a === "video_too_large" && s.max_pixels ? i("errors.videoTooLargeBy", c) ?? e.errors.video_too_large : a === "video_aspect_unsupported" && s.width && s.height && s.min_aspect && s.max_aspect ? i("errors.videoAspectBy", c) ?? e.errors.video_aspect_unsupported : a === "too_many_files" && s.max ? i("errors.tooManyFilesBy", c) ?? e.errors.too_many_files : a && i(`errors.${a}`, c) || (o && (r.refusal ?? (r.status !== void 0 && r.status >= 400 && r.status < 500)) ? o : e.errors.generic);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function l(e) {
|
|
79
|
+
if (!e) return "";
|
|
80
|
+
let t = e.split("/")[1] ?? e;
|
|
81
|
+
return (t.split("+")[0] ?? t).replace(/^x-/, "").toUpperCase().replace(/^JPG$/, "JPEG").replace(/^WEBP$/, "WebP");
|
|
82
|
+
}
|
|
83
|
+
function u(e) {
|
|
84
|
+
let t = e / 1048576;
|
|
85
|
+
return t >= 1024 ? `${+(t / 1024).toFixed(1)} GB` : `${+t.toFixed(+(t < 10))} MB`;
|
|
86
|
+
}
|
|
87
|
+
function d(e) {
|
|
88
|
+
let t = e.replace(/^media(\/\w+)?: /, "");
|
|
89
|
+
return t.charAt(0).toUpperCase() + t.slice(1) + (/[.!?]$/.test(t) ? "" : ".");
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { c as createTranslator, n as defaultMessages, r as defineMessages, l as formatName, o as interpolate, u as megabytes, a as resolveMessages };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","names":[],"sources":["../../src/i18n/messages.ts"],"sourcesContent":["import { en } from \"../locales/en.js\";\nimport type { ErrorDetails } from \"../client/generated/wire.js\";\nimport { ratioLabel } from \"../client/media/rules.js\";\n\n\ntype Widen<T> = { [K in keyof T]: T[K] extends string ? string : Widen<T[K]> };\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends string ? string : DeepPartial<T[K]> };\ntype Paths<T, P extends string = \"\"> = {\n [K in keyof T & string]: T[K] extends string ? `${P}${K}` : Paths<T[K], `${P}${K}.`>;\n}[keyof T & string];\n\n/** The complete message tree; English is the reference shape. */\nexport type ContentKitUiMessages = Widen<typeof en>;\n/** A locale bundle or host override: any subset of the tree. */\nexport type ContentKitUiMessageBundle = DeepPartial<ContentKitUiMessages>;\n/** Dotted key of any message, e.g. `crop.title`. */\nexport type MessageKey = Paths<ContentKitUiMessages>;\nexport type MessageVars = Record<string, string | number>;\n/** Host translation hook; return nothing (or the key) to use ours. */\nexport type ContentKitUiTranslate = (key: string, vars?: MessageVars) => string | null | undefined;\n\nexport const defaultMessages: ContentKitUiMessages = en;\n\nexport function defineMessages(bundle: ContentKitUiMessageBundle): ContentKitUiMessageBundle {\n return bundle;\n}\n\ntype Tree = { [key: string]: string | Tree };\n\nfunction mergeInto(target: Tree, source: Tree): Tree {\n const out: Tree = { ...target };\n for (const [key, value] of Object.entries(source)) {\n if (value === undefined || value === null) continue;\n const current = out[key];\n if (typeof value === \"string\") {\n if (value !== \"\") out[key] = value;\n } else out[key] = mergeInto(typeof current === \"object\" ? current : {}, value);\n }\n return out;\n}\n\n/** Layers bundles over English; later bundles win, missing keys fall back. */\nexport function resolveMessages(bundles?: ContentKitUiMessageBundle | readonly ContentKitUiMessageBundle[]): ContentKitUiMessages {\n const list = bundles ? (Array.isArray(bundles) ? bundles : [bundles]) : [];\n let tree = en as unknown as Tree;\n for (const b of list) tree = mergeInto(tree, b as Tree);\n return tree as unknown as ContentKitUiMessages;\n}\n\nexport function interpolate(template: string, vars?: MessageVars): string {\n if (!vars) return template;\n return template.replace(/\\{(\\w+)\\}/g, (m, name: string) => (name in vars ? String(vars[name]) : m));\n}\n\nfunction lookup(messages: ContentKitUiMessages, key: string): string | undefined {\n let node: unknown = messages;\n for (const part of key.split(\".\")) {\n if (!node || typeof node !== \"object\") return undefined;\n node = (node as Tree)[part];\n }\n return typeof node === \"string\" ? node : undefined;\n}\n\nexport interface Translator {\n messages: ContentKitUiMessages;\n /** The UI's BCP 47 language (dates, plurals); undefined: the browser's. */\n language?: string;\n t(key: MessageKey, vars?: MessageVars): string;\n /** key_one or key_other by count (as the language's plural rules pick), with {count}. */\n plural(key: string, count: number, vars?: MessageVars): string;\n /** Message for a ContentKitError (or its code). */\n error(error: unknown): string;\n}\n\nexport function createTranslator(messages: ContentKitUiMessages, hostT?: ContentKitUiTranslate, language?: string): Translator {\n const translate = (key: string, vars?: MessageVars) => {\n const hosted = hostT?.(key, vars);\n if (hosted && hosted !== key) return hosted;\n const own = lookup(messages, key);\n return own === undefined ? undefined : interpolate(own, vars);\n };\n let rules: Intl.PluralRules | undefined;\n return {\n messages,\n language,\n t: (key, vars) => translate(key, vars) ?? key,\n plural(key, count, vars) {\n rules ??= new Intl.PluralRules(language);\n const all = { ...vars, count };\n return translate(`${key}_${rules.select(count)}`, all) ?? translate(`${key}_other`, all) ?? key;\n },\n error(error) {\n if (typeof error === \"string\") return translate(`errors.${error}`, { seconds: 60 }) ?? messages.errors.generic;\n const e = (error ?? {}) as { code?: unknown; message?: unknown; status?: number; retryAfter?: number; details?: ErrorDetails; refusal?: boolean };\n const code = typeof e.code === \"string\" ? e.code : undefined;\n const server = typeof e.message === \"string\" && e.message ? sentence(e.message) : undefined;\n const d = e.details ?? {};\n const vars: MessageVars = {\n seconds: e.retryAfter ?? 60,\n width: d.width ?? \"\",\n height: d.height ?? \"\",\n min: d.min_width ?? \"\",\n megapixels: d.max_pixels ? Math.round(d.max_pixels / 1e6) : \"\",\n format: formatName(d.type),\n allowed: (d.allowed ?? []).map(formatName).join(\", \"),\n size: d.size ? megabytes(d.size) : \"\",\n max: d.max_bytes ? megabytes(d.max_bytes) : \"\",\n frames: d.frames ?? \"\",\n maxFrames: d.max_frames ?? \"\",\n maxSeconds: d.max_seconds ?? \"\",\n duration: d.seconds ?? \"\",\n shape: d.width && d.height ? ratioLabel(d.width / d.height) : \"\",\n minAspect: d.min_aspect ? ratioLabel(d.min_aspect) : \"\",\n maxAspect: d.max_aspect ? ratioLabel(d.max_aspect) : \"\",\n maxFiles: d.max ?? \"\",\n maxChars: d.max ?? \"\",\n };\n // A refusal the server words itself states its rule; show it rather than a vaguer line.\n if (code === \"invalid_request\" && server) return server;\n if (code === \"type_not_allowed\" && d.allowed?.length) return `${translate(\"errors.type_not_allowed\", vars)} ${translate(\"errors.allowedTypes\", vars)}`;\n if (code === \"comment_too_long\" && d.max) return translate(\"errors.commentTooLongBy\", vars) ?? messages.errors.comment_too_long;\n if (code === \"too_large\" && d.max_bytes) return translate(\"errors.tooLargeBy\", vars) ?? messages.errors.too_large;\n if (code === \"image_too_large\" && (d.frames ?? 0) > 1) return translate(\"errors.animationTooLarge\", vars) ?? messages.errors.image_too_large;\n if (code === \"animation_too_long\" && (d.max_frames || d.max_seconds)) return translate(d.max_frames ? \"errors.animationFrames\" : \"errors.animationSeconds\", vars) ?? messages.errors.generic;\n if (code === \"video_too_long\" && d.max_seconds) return translate(\"errors.videoTooLongBy\", vars) ?? messages.errors.video_too_long;\n if (code === \"video_too_large\" && d.max_pixels) return translate(\"errors.videoTooLargeBy\", vars) ?? messages.errors.video_too_large;\n if (code === \"video_aspect_unsupported\" && d.width && d.height && d.min_aspect && d.max_aspect) return translate(\"errors.videoAspectBy\", vars) ?? messages.errors.video_aspect_unsupported;\n if (code === \"too_many_files\" && d.max) return translate(\"errors.tooManyFilesBy\", vars) ?? messages.errors.too_many_files;\n const own = code && translate(`errors.${code}`, vars);\n if (own) return own;\n // An unknown refusal (4xx) says what is wrong; faults get the generic line.\n if (server && (e.refusal ?? (e.status !== undefined && e.status >= 400 && e.status < 500))) return server;\n return messages.errors.generic;\n },\n };\n}\n\n/** \"image/avif\" → \"AVIF\". */\nexport function formatName(type?: string): string {\n if (!type) return \"\";\n const sub = type.split(\"/\")[1] ?? type;\n return (sub.split(\"+\")[0] ?? sub).replace(/^x-/, \"\").toUpperCase().replace(/^JPG$/, \"JPEG\").replace(/^WEBP$/, \"WebP\");\n}\n\n/** A byte size as the messages state it: \"2.5 MB\", \"25 MB\", \"20 GB\". */\nexport function megabytes(n: number): string {\n const mb = n / (1024 * 1024);\n return mb >= 1024 ? `${+(mb / 1024).toFixed(1)} GB` : `${+mb.toFixed(mb < 10 ? 1 : 0)} MB`;\n}\n\nfunction sentence(s: string): string {\n const t = s.replace(/^media(\\/\\w+)?: /, \"\");\n return t.charAt(0).toUpperCase() + t.slice(1) + (/[.!?]$/.test(t) ? \"\" : \".\");\n}\n"],"mappings":";;;AAqBA,IAAa,IAAwC;AAErD,SAAgB,EAAe,GAA8D;CAC3F,OAAO;AACT;AAIA,SAAS,EAAU,GAAc,GAAoB;CACnD,IAAM,IAAY,EAAE,GAAG,EAAO;CAC9B,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAM,GAAG;EACjD,IAAI,KAAiC,MAAM;EAC3C,IAAM,IAAU,EAAI;EACpB,AAAI,OAAO,KAAU,WACf,MAAU,OAAI,EAAI,KAAO,KACxB,EAAI,KAAO,EAAU,OAAO,KAAY,WAAW,IAAU,CAAC,GAAG,CAAK;CAC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AS,KAAK,CAAC,IAAI,KAAK;AAC3E"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { ContentKitUiProvider, type ContentKitUiProviderProps } from './provider.js';
|
|
2
|
+
export { ContentKitUiRoot } from './scope.js';
|
|
3
|
+
export type { ContentKitUiAppearance, ContentKitUiTheme, ContentKitUiVariables } from './appearance.js';
|
|
4
|
+
export { EncodeProgress, encodeLabel, formatRemaining, type EncodeProgressProps } from './components/encode-progress.js';
|
|
5
|
+
export { ImageCropDialog, type ImageCropDialogProps } from './components/image-crop-dialog.js';
|
|
6
|
+
export { SlotImage, type SlotImageProps } from './components/slot-image.js';
|
|
7
|
+
export { DensityContext, RenditionImg, useRendition, type RenditionImgProps, type UseRenditionOptions } from './components/rendition-img.js';
|
|
8
|
+
export { SlotEditError, SlotEditMenu, SlotEditor, useSlotEditor, type SlotEditMenuProps, type SlotEditorProps, type SlotEditorState, } from './components/slot-editor.js';
|
|
9
|
+
export { VideoPoster, type VideoPosterProps } from './components/video-poster.js';
|
|
10
|
+
export { VideoPosterPicker, formatTime, type VideoPickerProps, type VideoPosterPickerProps } from './components/video-poster-picker.js';
|
|
11
|
+
export { MediaGallery, type MediaGalleryProps } from './components/media-gallery.js';
|
|
12
|
+
export { SpriteFrame, VideoPlayer, qualityLabel, type PlayerEvent, type PlayerHandoff, type PlayerMenuItem, type PlayerSlotContext, type VideoPlayerProps, } from './components/video-player.js';
|
|
13
|
+
export { VideoMiniPlayer, type VideoMiniPlayerProps } from './components/video-mini-player.js';
|
|
14
|
+
export { playerButtonClass } from './components/player-controls.js';
|
|
15
|
+
export { AvatarUpload, CoverUpload, type SlotUploadProps } from './components/slot-upload.js';
|
|
16
|
+
export { MediaFolderEditor, describeRules, type MediaFolderEditorHandle, type MediaFolderEditorProps } from './components/media-folder-editor.js';
|
|
17
|
+
export { SortableList, type SortableListProps } from './components/sortable-list.js';
|
|
18
|
+
export { HoverPreview, type HoverPreviewProps } from './components/hover-preview.js';
|
|
19
|
+
export { LazyMount, type LazyMountProps } from './components/lazy-mount.js';
|
|
20
|
+
export { MediaReadinessNotice, type MediaReadinessNoticeProps } from './components/media-readiness-notice.js';
|
|
21
|
+
export * from './components/social/index.js';
|
|
22
|
+
export { createTranslator, defaultMessages, defineMessages, resolveMessages, type MessageKey, type MessageVars, type Translator, type ContentKitUiMessageBundle, type ContentKitUiMessages, type ContentKitUiTranslate, } from './i18n/messages.js';
|
|
23
|
+
export { useMessages } from './i18n/context.js';
|