@vantageos/mosaic-blocks 0.4.7-alpha → 0.4.8-alpha
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 +5 -4
- package/dist/index.cjs +204 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +186 -2
- package/dist/index.d.ts +186 -2
- package/dist/index.js +204 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { Menu } from '@base-ui/react/menu';
|
|
|
27
27
|
import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
28
28
|
|
|
29
29
|
// src/version.ts
|
|
30
|
-
var version = "0.4.
|
|
30
|
+
var version = "0.4.8-alpha";
|
|
31
31
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
32
32
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
33
33
|
}
|
|
@@ -11262,7 +11262,209 @@ function MosaicDocumentUpload({
|
|
|
11262
11262
|
] });
|
|
11263
11263
|
}
|
|
11264
11264
|
MosaicDocumentUpload.displayName = "MosaicDocumentUpload";
|
|
11265
|
+
var urlScraperInputVariants = cva(
|
|
11266
|
+
[
|
|
11267
|
+
"min-h-9 flex-1 rounded-md border bg-transparent px-3 text-sm outline-none",
|
|
11268
|
+
"transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50"
|
|
11269
|
+
],
|
|
11270
|
+
{
|
|
11271
|
+
variants: {
|
|
11272
|
+
invalid: {
|
|
11273
|
+
true: "border-destructive",
|
|
11274
|
+
false: "border-border"
|
|
11275
|
+
}
|
|
11276
|
+
},
|
|
11277
|
+
defaultVariants: {
|
|
11278
|
+
invalid: false
|
|
11279
|
+
}
|
|
11280
|
+
}
|
|
11281
|
+
);
|
|
11282
|
+
var urlScraperMessageVariants = cva(["text-sm"], {
|
|
11283
|
+
variants: {
|
|
11284
|
+
tone: {
|
|
11285
|
+
error: "text-destructive",
|
|
11286
|
+
muted: "text-muted-foreground"
|
|
11287
|
+
}
|
|
11288
|
+
},
|
|
11289
|
+
defaultVariants: {
|
|
11290
|
+
tone: "muted"
|
|
11291
|
+
}
|
|
11292
|
+
});
|
|
11293
|
+
var urlScraperCardVariants = cva(["flex flex-col gap-2 rounded-lg border p-4"], {
|
|
11294
|
+
variants: {
|
|
11295
|
+
tone: {
|
|
11296
|
+
neutral: "border-border bg-card",
|
|
11297
|
+
error: "border-destructive/40 bg-destructive/5"
|
|
11298
|
+
}
|
|
11299
|
+
},
|
|
11300
|
+
defaultVariants: {
|
|
11301
|
+
tone: "neutral"
|
|
11302
|
+
}
|
|
11303
|
+
});
|
|
11304
|
+
function cn72(...classes) {
|
|
11305
|
+
return classes.filter(Boolean).join(" ");
|
|
11306
|
+
}
|
|
11307
|
+
function isSyntacticallyValidUrl(candidate) {
|
|
11308
|
+
try {
|
|
11309
|
+
new URL(candidate);
|
|
11310
|
+
return true;
|
|
11311
|
+
} catch {
|
|
11312
|
+
return false;
|
|
11313
|
+
}
|
|
11314
|
+
}
|
|
11315
|
+
function MosaicUrlScraper(props) {
|
|
11316
|
+
const {
|
|
11317
|
+
url,
|
|
11318
|
+
onUrlChange,
|
|
11319
|
+
onScrape,
|
|
11320
|
+
inputAriaLabel,
|
|
11321
|
+
inputPlaceholder,
|
|
11322
|
+
scrapeButtonLabel,
|
|
11323
|
+
invalidUrlMessage,
|
|
11324
|
+
className,
|
|
11325
|
+
ref
|
|
11326
|
+
} = props;
|
|
11327
|
+
const [isLocallyInvalid, setIsLocallyInvalid] = useState(false);
|
|
11328
|
+
const isBusy = props.status === "loading" || props.status === "success";
|
|
11329
|
+
function handleSubmit(event) {
|
|
11330
|
+
event.preventDefault();
|
|
11331
|
+
const trimmed = url.trim();
|
|
11332
|
+
if (!isSyntacticallyValidUrl(trimmed)) {
|
|
11333
|
+
setIsLocallyInvalid(true);
|
|
11334
|
+
return;
|
|
11335
|
+
}
|
|
11336
|
+
setIsLocallyInvalid(false);
|
|
11337
|
+
onScrape(trimmed);
|
|
11338
|
+
}
|
|
11339
|
+
function handleUrlChange(event) {
|
|
11340
|
+
setIsLocallyInvalid(false);
|
|
11341
|
+
onUrlChange(event.target.value);
|
|
11342
|
+
}
|
|
11343
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "url-scraper", className: cn72("flex flex-col gap-4", className), children: [
|
|
11344
|
+
/* @__PURE__ */ jsxs(
|
|
11345
|
+
"form",
|
|
11346
|
+
{
|
|
11347
|
+
"data-slot": "url-scraper-form",
|
|
11348
|
+
onSubmit: handleSubmit,
|
|
11349
|
+
className: "flex flex-col gap-2 md:flex-row",
|
|
11350
|
+
children: [
|
|
11351
|
+
/* @__PURE__ */ jsx(
|
|
11352
|
+
"input",
|
|
11353
|
+
{
|
|
11354
|
+
type: "url",
|
|
11355
|
+
"data-slot": "url-scraper-input",
|
|
11356
|
+
"aria-label": inputAriaLabel,
|
|
11357
|
+
placeholder: inputPlaceholder,
|
|
11358
|
+
value: url,
|
|
11359
|
+
onChange: handleUrlChange,
|
|
11360
|
+
disabled: isBusy,
|
|
11361
|
+
className: urlScraperInputVariants({ invalid: isLocallyInvalid })
|
|
11362
|
+
}
|
|
11363
|
+
),
|
|
11364
|
+
/* @__PURE__ */ jsx(
|
|
11365
|
+
"button",
|
|
11366
|
+
{
|
|
11367
|
+
type: "submit",
|
|
11368
|
+
"data-slot": "url-scraper-submit-button",
|
|
11369
|
+
disabled: isBusy,
|
|
11370
|
+
className: "min-h-9 inline-flex items-center justify-center rounded-md border border-border px-4 text-sm font-medium transition-colors hover:bg-accent/50 disabled:opacity-50",
|
|
11371
|
+
children: props.status === "loading" ? props.scrapingLabel : scrapeButtonLabel
|
|
11372
|
+
}
|
|
11373
|
+
)
|
|
11374
|
+
]
|
|
11375
|
+
}
|
|
11376
|
+
),
|
|
11377
|
+
isLocallyInvalid && /* @__PURE__ */ jsx(
|
|
11378
|
+
"p",
|
|
11379
|
+
{
|
|
11380
|
+
"data-slot": "url-scraper-invalid-message",
|
|
11381
|
+
className: urlScraperMessageVariants({ tone: "error" }),
|
|
11382
|
+
children: invalidUrlMessage
|
|
11383
|
+
}
|
|
11384
|
+
),
|
|
11385
|
+
props.status === "loading" && /* @__PURE__ */ jsx(
|
|
11386
|
+
"output",
|
|
11387
|
+
{
|
|
11388
|
+
"data-slot": "url-scraper-loading",
|
|
11389
|
+
className: urlScraperCardVariants({ tone: "neutral" }),
|
|
11390
|
+
children: /* @__PURE__ */ jsx("p", { className: urlScraperMessageVariants({ tone: "muted" }), children: props.loadingMessage })
|
|
11391
|
+
}
|
|
11392
|
+
),
|
|
11393
|
+
props.status === "error" && /* @__PURE__ */ jsxs("div", { "data-slot": "url-scraper-error", className: urlScraperCardVariants({ tone: "error" }), children: [
|
|
11394
|
+
/* @__PURE__ */ jsx(
|
|
11395
|
+
"p",
|
|
11396
|
+
{
|
|
11397
|
+
"data-slot": "url-scraper-error-message",
|
|
11398
|
+
className: urlScraperMessageVariants({ tone: "error" }),
|
|
11399
|
+
children: props.errorMessage
|
|
11400
|
+
}
|
|
11401
|
+
),
|
|
11402
|
+
/* @__PURE__ */ jsx(
|
|
11403
|
+
"button",
|
|
11404
|
+
{
|
|
11405
|
+
type: "button",
|
|
11406
|
+
"data-slot": "url-scraper-reset-button",
|
|
11407
|
+
onClick: props.onReset,
|
|
11408
|
+
className: "min-h-9 inline-flex w-fit items-center justify-center rounded-md border border-border px-3 text-sm font-medium transition-colors hover:bg-accent/50",
|
|
11409
|
+
children: props.resetButtonLabel
|
|
11410
|
+
}
|
|
11411
|
+
)
|
|
11412
|
+
] }),
|
|
11413
|
+
props.status === "success" && /* @__PURE__ */ jsxs(
|
|
11414
|
+
"div",
|
|
11415
|
+
{
|
|
11416
|
+
"data-slot": "url-scraper-content",
|
|
11417
|
+
className: urlScraperCardVariants({ tone: "neutral" }),
|
|
11418
|
+
children: [
|
|
11419
|
+
props.content.image !== void 0 && /* @__PURE__ */ jsx(
|
|
11420
|
+
"img",
|
|
11421
|
+
{
|
|
11422
|
+
"data-slot": "url-scraper-image",
|
|
11423
|
+
src: props.content.image,
|
|
11424
|
+
alt: props.imageAlt(props.content.title),
|
|
11425
|
+
className: "h-32 w-full rounded-md object-cover md:h-48"
|
|
11426
|
+
}
|
|
11427
|
+
),
|
|
11428
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
11429
|
+
/* @__PURE__ */ jsx("h3", { "data-slot": "url-scraper-title", className: "text-base font-semibold md:text-lg", children: props.content.title }),
|
|
11430
|
+
/* @__PURE__ */ jsx(
|
|
11431
|
+
"a",
|
|
11432
|
+
{
|
|
11433
|
+
"data-slot": "url-scraper-link",
|
|
11434
|
+
href: props.content.url,
|
|
11435
|
+
target: "_blank",
|
|
11436
|
+
rel: "noopener noreferrer",
|
|
11437
|
+
"aria-label": props.openLinkAriaLabel(props.content.url),
|
|
11438
|
+
className: "shrink-0 text-sm text-muted-foreground transition-colors hover:text-foreground",
|
|
11439
|
+
children: "\u2197"
|
|
11440
|
+
}
|
|
11441
|
+
)
|
|
11442
|
+
] }),
|
|
11443
|
+
/* @__PURE__ */ jsx(
|
|
11444
|
+
"p",
|
|
11445
|
+
{
|
|
11446
|
+
"data-slot": "url-scraper-description",
|
|
11447
|
+
className: urlScraperMessageVariants({ tone: "muted" }),
|
|
11448
|
+
children: props.content.description
|
|
11449
|
+
}
|
|
11450
|
+
),
|
|
11451
|
+
/* @__PURE__ */ jsx(
|
|
11452
|
+
"button",
|
|
11453
|
+
{
|
|
11454
|
+
type: "button",
|
|
11455
|
+
"data-slot": "url-scraper-reset-button",
|
|
11456
|
+
onClick: props.onReset,
|
|
11457
|
+
className: "min-h-9 inline-flex w-fit items-center justify-center rounded-md border border-border px-3 text-sm font-medium transition-colors hover:bg-accent/50",
|
|
11458
|
+
children: props.resetButtonLabel
|
|
11459
|
+
}
|
|
11460
|
+
)
|
|
11461
|
+
]
|
|
11462
|
+
}
|
|
11463
|
+
)
|
|
11464
|
+
] });
|
|
11465
|
+
}
|
|
11466
|
+
MosaicUrlScraper.displayName = "MosaicUrlScraper";
|
|
11265
11467
|
|
|
11266
|
-
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11468
|
+
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11267
11469
|
//# sourceMappingURL=index.js.map
|
|
11268
11470
|
//# sourceMappingURL=index.js.map
|