diff --git a/.changeset/2.4.1-11.11.7.md b/.changeset/2.4.1-11.11.7.md new file mode 100644 index 00000000..05047664 --- /dev/null +++ b/.changeset/2.4.1-11.11.7.md @@ -0,0 +1,5 @@ +--- +unframer: patch +--- + +Update framer to 2.4.1, update framer motion to 11.11.7 \ No newline at end of file diff --git a/unframer/src/framer.js b/unframer/src/framer.js index 56f4af2a..80c462b8 100644 --- a/unframer/src/framer.js +++ b/unframer/src/framer.js @@ -517370,7 +517370,7 @@ function steps(numSteps, direction = 'end',) { }; } -// /:https://app.framerstatic.com/framer.RI2PKL5I.mjs +// /:https://app.framerstatic.com/framer.5IYC6IGH.mjs init_chunk_QLPHEVXG(); import React4 from 'react'; import { Suspense as Suspense3, } from 'react'; @@ -519496,13 +519496,6 @@ async function getLocalizedNavigationPath({ } return result; } -function getPageEffectForRoute(currentRouteId, nextRouteId, { - global, - routes, -},) { - var _a; - return ((_a = routes[currentRouteId]) == null ? void 0 : _a[nextRouteId]) || global; -} var defaultSitePageEffects = { global: void 0, routes: {}, @@ -519520,6 +519513,13 @@ function PageEffectsProvider({ function usePageEffects() { return React4.useContext(PageEffectsContext,); } +function getPageEffectForRoute(currentRouteId, nextRouteId, { + global, + routes, +},) { + var _a; + return ((_a = routes[currentRouteId]) == null ? void 0 : _a[nextRouteId]) || global; +} var step = 10; var maxDuration3 = 1e4; function createLinearEasing(generator,) { @@ -521784,22 +521784,6 @@ var cssNames = { yellow: 'ff0', yellowgreen: '9acd32', }; -var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => { - ColorFormat2['RGB'] = 'rgb'; - ColorFormat2['HSL'] = 'hsl'; - ColorFormat2['HSV'] = 'hsv'; - ColorFormat2['HEX'] = 'hex'; - ColorFormat2['NAME'] = 'name'; - return ColorFormat2; -})(ColorFormat || {},); -var ColorMixModelType = /* @__PURE__ */ ((ColorMixModelType2) => { - ColorMixModelType2['RGB'] = 'rgb'; - ColorMixModelType2['RGBA'] = 'rgba'; - ColorMixModelType2['HSL'] = 'hsl'; - ColorMixModelType2['HSLA'] = 'hsla'; - ColorMixModelType2['HUSL'] = 'husl'; - return ColorMixModelType2; -})(ColorMixModelType || {},); function modulate(value, rangeA, rangeB, limit = false,) { const [fromLow, fromHigh,] = rangeA; const [toLow, toHigh,] = rangeB; @@ -521844,6 +521828,22 @@ function numberFromString(input,) { const match = /\d?\.?\d+/u.exec(input,); return match ? Number(match[0],) : void 0; } +var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => { + ColorFormat2['RGB'] = 'rgb'; + ColorFormat2['HSL'] = 'hsl'; + ColorFormat2['HSV'] = 'hsv'; + ColorFormat2['HEX'] = 'hex'; + ColorFormat2['NAME'] = 'name'; + return ColorFormat2; +})(ColorFormat || {},); +var ColorMixModelType = /* @__PURE__ */ ((ColorMixModelType2) => { + ColorMixModelType2['RGB'] = 'rgb'; + ColorMixModelType2['RGBA'] = 'rgba'; + ColorMixModelType2['HSL'] = 'hsl'; + ColorMixModelType2['HSLA'] = 'hsla'; + ColorMixModelType2['HUSL'] = 'husl'; + return ColorMixModelType2; +})(ColorMixModelType || {},); var Hsluv = /* @__PURE__ */ (() => require_hsluv().Hsluv)(); var hsluvConverter = /* @__PURE__ */ new Hsluv(); function rgbToHsluv(r, g, b,) { @@ -528379,51 +528379,6 @@ function BackgroundImageComponent({ children: imageNode, },); } -var key = 'src'; -var BackgroundImage = { - isImageObject: function (image,) { - if (!image || typeof image === 'string') return false; - return key in image; - }, -}; -function applyForwardOverrides(background, props,) { - const { - _forwardedOverrideId, - _forwardedOverrides, - id: id3, - } = props; - const forwardedOverrideId = _forwardedOverrideId ?? id3; - const src = _forwardedOverrides && forwardedOverrideId ? _forwardedOverrides[forwardedOverrideId] : void 0; - if (src && typeof src === 'string') { - background = { - ...background, - src, - }; - } - return background; -} -function backgroundImageFromProps(props,) { - const { - background, - image, - } = props; - if (image !== void 0 && background && !BackgroundImage.isImageObject(background,)) { - return; - } - let backgroundImage = null; - if (isString(image,)) { - backgroundImage = { - alt: '', - src: image, - }; - } else { - backgroundImage = Animatable.get(background, null,); - } - if (!BackgroundImage.isImageObject(backgroundImage,)) { - return; - } - return applyForwardOverrides(backgroundImage, props,); -} function collectBorderStyleForProps(props, style, collapseEqualBorders = true,) { const { borderWidth, @@ -528490,6 +528445,51 @@ function Border(props,) { layoutId, },); } +var key = 'src'; +var BackgroundImage = { + isImageObject: function (image,) { + if (!image || typeof image === 'string') return false; + return key in image; + }, +}; +function applyForwardOverrides(background, props,) { + const { + _forwardedOverrideId, + _forwardedOverrides, + id: id3, + } = props; + const forwardedOverrideId = _forwardedOverrideId ?? id3; + const src = _forwardedOverrides && forwardedOverrideId ? _forwardedOverrides[forwardedOverrideId] : void 0; + if (src && typeof src === 'string') { + background = { + ...background, + src, + }; + } + return background; +} +function backgroundImageFromProps(props,) { + const { + background, + image, + } = props; + if (image !== void 0 && background && !BackgroundImage.isImageObject(background,)) { + return; + } + let backgroundImage = null; + if (isString(image,)) { + backgroundImage = { + alt: '', + src: image, + }; + } else { + backgroundImage = Animatable.get(background, null,); + } + if (!BackgroundImage.isImageObject(backgroundImage,)) { + return; + } + return applyForwardOverrides(backgroundImage, props,); +} function htmlElementAsMotionComponent(asElem,) { return asElem && asElem !== 'search' && asElem !== 'slot' && asElem !== 'template' ? motion[asElem] : motion['div']; } @@ -537594,7 +537594,8 @@ var withFX = (Component18) => ref: forwardedRef, },); } - if (RenderTarget.current() === RenderTarget.canvas) { + const currentTarget = RenderTarget.current(); + if (currentTarget === RenderTarget.canvas || currentTarget === RenderTarget.export) { const animate4 = isVariantOrVariantList(props.animate,) ? props.animate : void 0; const initial2 = isVariantOrVariantList(props.initial,) ? props.initial : void 0; return /* @__PURE__ */ jsx(Component18, { @@ -538036,6 +538037,19 @@ var DeprecatedContainerErrorBoundary = class extends Component { return hasError ? null : children; } }; +var IsInExternalComponentContext = /* @__PURE__ */ (() => React4.createContext(0,))(); +function useExternalComponentNestingLevel() { + return React4.useContext(IsInExternalComponentContext,); +} +function IsExternalComponent({ + children, +},) { + const count = React4.useContext(IsInExternalComponentContext,); + return /* @__PURE__ */ jsx(IsInExternalComponentContext.Provider, { + value: count + 1, + children, + },); +} var CRASH_ERROR_MESSAGE_PREFIX = 'code-crash:'; function formatCodeCrashLocationFromSourceNode(scopeId, nodeId,) { return `${CRASH_ERROR_MESSAGE_PREFIX}${scopeId}:${nodeId}`; @@ -538051,19 +538065,6 @@ function getErrorMessageFor(element, scopeId, nodeId,) { formatCodeCrashLocationFromSourceNode(scopeId, nodeId,) } \u2192 click \u201CShow Layer\u201D.`; } -var IsInExternalComponentContext = /* @__PURE__ */ (() => React4.createContext(0,))(); -function useExternalComponentNestingLevel() { - return React4.useContext(IsInExternalComponentContext,); -} -function IsExternalComponent({ - children, -},) { - const count = React4.useContext(IsInExternalComponentContext,); - return /* @__PURE__ */ jsx(IsInExternalComponentContext.Provider, { - value: count + 1, - children, - },); -} function shouldWrapComponentWithBoundary(externalModuleNestingLevel, isAuthoredByUser, isExternalComponent, inComponentSlot,) { const isLocalComponentInstance = // We know a component instance is local when it’s not nested inside any external component... @@ -539247,6 +539248,28 @@ function withChildrenCanSuspend(Component18,) { },); },); } +var NestedLinksCollector = class { + constructor() { + __publicField(this, 'links', /* @__PURE__ */ new Map(),); + } + clear() { + this.links.clear(); + } + getLinks() { + return this.links; + } + addLink(parentLinkNodeId, linkNodeId,) { + if (typeof window !== 'undefined' && true || !parentLinkNodeId || !linkNodeId) { + return; + } + if (!this.links.has(parentLinkNodeId,)) { + this.links.set(parentLinkNodeId, /* @__PURE__ */ new Set(),); + } + const entry = this.links.get(parentLinkNodeId,); + entry.add(linkNodeId,); + } +}; +var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector(); var elementKey = 'element'; var collectionKey = 'collection'; var collectionItemIdKey = 'collectionItemId'; @@ -539331,28 +539354,6 @@ function navigateFromAttributes(navigate, element, implicitPathVariables,) { navigate(routeId, elementId, Object.assign({}, implicitPathVariables, pathVariables,), smoothScroll,); return true; } -var NestedLinksCollector = class { - constructor() { - __publicField(this, 'links', /* @__PURE__ */ new Map(),); - } - clear() { - this.links.clear(); - } - getLinks() { - return this.links; - } - addLink(parentLinkNodeId, linkNodeId,) { - if (typeof window !== 'undefined' && true || !parentLinkNodeId || !linkNodeId) { - return; - } - if (!this.links.has(parentLinkNodeId,)) { - this.links.set(parentLinkNodeId, /* @__PURE__ */ new Set(),); - } - const entry = this.links.get(parentLinkNodeId,); - entry.add(linkNodeId,); - } -}; -var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector(); var PRELOAD_AFTER_MS = 500; var OBSERVER_THRESHOLD = 0.9; var LOW_MEMORY_THRESHOLD = 1.7; @@ -541313,8 +541314,19 @@ function PageRoot({ function EditorBarLauncher({ EditorBar, },) { + const libraryFeatures = useLibraryFeatures(); const [mounted, setMounted,] = useState(false,); const framerSiteId = useContext(FormContext,); + const editorBarFeatures = useMemo(() => { + const features = {}; + let key7; + for (key7 in libraryFeatures) { + if (libraryFeatures.hasOwnProperty(key7,) && key7.startsWith('editorBar',)) { + features[key7] = libraryFeatures[key7]; + } + } + return features; + }, [libraryFeatures,],); useEffect(() => { startTransition2(() => { setMounted(true,); @@ -541325,6 +541337,7 @@ function EditorBarLauncher({ children: /* @__PURE__ */ jsx(Suspense3, { children: /* @__PURE__ */ jsx(EditorBar, { framerSiteId, + features: editorBarFeatures, },), },), },); @@ -542573,6 +542586,52 @@ var Fields = class extends Metadata { __publicField(this, 'name', 'Fields',); } }; +var OrderingField = class { + constructor(field, direction = 'asc',) { + this.field = field; + this.direction = direction; + } + getHash() { + return calculateHash('OrderingField', this.field.id, this.direction,); + } +}; +var Ordering = class { + constructor(ordering,) { + __publicField(this, 'fields', [],); + if (ordering) { + this.merge(ordering,); + } + } + get length() { + return this.fields.length; + } + getHash() { + return calculateHash('Ordering', ...this.fields,); + } + push(field,) { + this.fields.push(field,); + } + merge(ordering,) { + this.fields.push(...ordering.fields,); + } + equals(other,) { + if (this === other) return true; + if (this.length !== other.length) return false; + return this.getHash() === other.getHash(); + } + providedByFields(fields,) { + for ( + const { + field, + } of this.fields + ) { + if (fields.has(field,)) continue; + if (field.name === VIRTUAL_INDEX_FIELD) continue; + return false; + } + return true; + } +}; var RequiredProps = class { constructor(ordering, resolvedFields,) { this.ordering = ordering; @@ -542617,6 +542676,151 @@ var RequiredProps = class { return node.canProvideResolvedFields(this.resolvedFields,); } }; +var Scope = class { + constructor(parent,) { + this.parent = parent; + __publicField(this, 'node',); + __publicField(this, 'ordering',); + __publicField(this, 'fields', [],); + } + /** + * Returns the last node built in the scope and removes it from the scope. + * Throws an error if no node was built in the scope yet. + */ + takeNode() { + const node = this.node; + assert(node, 'Node is missing',); + this.node = void 0; + return node; + } + /** + * Sets the last node built in the scope. Throws an error if there is + * already a node in the scope. + */ + setNode(node,) { + assert(!this.node, 'Node already set',); + this.node = node; + } + setOrdering(ordering,) { + this.ordering = ordering; + } + /** + * Create a new scope with the this scope as its parent. + */ + push() { + return new Scope(this,); + } + /** + * Creates a new scope with the parent of the this scope as its parent. + */ + replace() { + return new Scope(this.parent,); + } + /** + * Adds a field to this scope. Any fields that are added will be available + * in the this scope and all of its children. + */ + addField(scopeField,) { + this.fields.push(scopeField,); + } + /** + * Merges all fields from the given scope into the this scope. + */ + addFieldsFromScope(scope,) { + for (const scopeField of scope.fields) { + this.addField(scopeField,); + } + } + /** + * Resolves a field from this scope. If the field is not found, the parent + * scope is checked. If the name of a field is ambiguous, an error is + * thrown. + */ + resolveField(name, collection,) { + var _a; + const candidates = []; + for (const field of this.fields) { + if (field.name !== name) continue; + if (collection && field.collectionName !== collection) continue; + candidates.push(field,); + } + if (candidates.length === 1) { + return candidates[0]; + } + if (candidates.length > 1) { + throw new Error('Ambiguous fields',); + } + return (_a = this.parent) == null ? void 0 : _a.resolveField(name, collection,); + } + /** + * Checks if the scope or any parent scope has the given scope field. + */ + has(scopeField,) { + var _a; + if (this.fields.includes(scopeField,)) { + return true; + } + return ((_a = this.parent) == null ? void 0 : _a.has(scopeField,)) ?? false; + } + /** + * Returns the required ordering for the scope. + */ + getRequiredOrdering() { + return this.ordering ?? new Ordering(); + } + /** + * Returns the required resolved fields for the scope. + */ + getRequiredResolvedFields() { + const resolvedFields = new Fields(); + for ( + const { + field, + } of this.fields + ) { + if (field.collection) { + resolvedFields.add(field,); + } + } + return resolvedFields; + } + /** + * Returns the set of required physical props for this scope. This is used + * to create the required props for the root node in the optimizer. + */ + getRequiredProps() { + const ordering = this.getRequiredOrdering(); + const resolvedFields = this.getRequiredResolvedFields(); + return new RequiredProps(ordering, resolvedFields,); + } + /** + * Returns a map of the fields in this scope, with their scope names as + * keys. This is used to create the final `QueryResult` with the correct + * field names. + */ + getNamedFields() { + const namedFields = {}; + for ( + const { + name, + field, + } of this.fields + ) { + namedFields[name] = field; + } + return namedFields; + } + /** + * Returns the single field from this scope if it only contains one field. + * Throws an error if there are more than one fields. + */ + getSingleField() { + assert(this.fields.length === 1, 'Scope must contain exactly one field',); + const scopeField = this.fields[0]; + assert(scopeField, 'Field must exist',); + return scopeField.field; + } +}; var Tuple = class { constructor() { __publicField(this, 'pointers', /* @__PURE__ */ new Map(),); @@ -542995,197 +543199,6 @@ var ScalarCase = class extends ScalarNode { return otherwise; } }; -var OrderingField = class { - constructor(field, direction = 'asc',) { - this.field = field; - this.direction = direction; - } - getHash() { - return calculateHash('OrderingField', this.field.id, this.direction,); - } -}; -var Ordering = class { - constructor(ordering,) { - __publicField(this, 'fields', [],); - if (ordering) { - this.merge(ordering,); - } - } - get length() { - return this.fields.length; - } - getHash() { - return calculateHash('Ordering', ...this.fields,); - } - push(field,) { - this.fields.push(field,); - } - merge(ordering,) { - this.fields.push(...ordering.fields,); - } - equals(other,) { - if (this === other) return true; - if (this.length !== other.length) return false; - return this.getHash() === other.getHash(); - } - providedByFields(fields,) { - for ( - const { - field, - } of this.fields - ) { - if (fields.has(field,)) continue; - if (field.name === VIRTUAL_INDEX_FIELD) continue; - return false; - } - return true; - } -}; -var Scope = class { - constructor(parent,) { - this.parent = parent; - __publicField(this, 'node',); - __publicField(this, 'ordering',); - __publicField(this, 'fields', [],); - } - /** - * Returns the last node built in the scope and removes it from the scope. - * Throws an error if no node was built in the scope yet. - */ - takeNode() { - const node = this.node; - assert(node, 'Node is missing',); - this.node = void 0; - return node; - } - /** - * Sets the last node built in the scope. Throws an error if there is - * already a node in the scope. - */ - setNode(node,) { - assert(!this.node, 'Node already set',); - this.node = node; - } - setOrdering(ordering,) { - this.ordering = ordering; - } - /** - * Create a new scope with the this scope as its parent. - */ - push() { - return new Scope(this,); - } - /** - * Creates a new scope with the parent of the this scope as its parent. - */ - replace() { - return new Scope(this.parent,); - } - /** - * Adds a field to this scope. Any fields that are added will be available - * in the this scope and all of its children. - */ - addField(scopeField,) { - this.fields.push(scopeField,); - } - /** - * Merges all fields from the given scope into the this scope. - */ - addFieldsFromScope(scope,) { - for (const scopeField of scope.fields) { - this.addField(scopeField,); - } - } - /** - * Resolves a field from this scope. If the field is not found, the parent - * scope is checked. If the name of a field is ambiguous, an error is - * thrown. - */ - resolveField(name, collection,) { - var _a; - const candidates = []; - for (const field of this.fields) { - if (field.name !== name) continue; - if (collection && field.collectionName !== collection) continue; - candidates.push(field,); - } - if (candidates.length === 1) { - return candidates[0]; - } - if (candidates.length > 1) { - throw new Error('Ambiguous fields',); - } - return (_a = this.parent) == null ? void 0 : _a.resolveField(name, collection,); - } - /** - * Checks if the scope or any parent scope has the given scope field. - */ - has(scopeField,) { - var _a; - if (this.fields.includes(scopeField,)) { - return true; - } - return ((_a = this.parent) == null ? void 0 : _a.has(scopeField,)) ?? false; - } - /** - * Returns the required ordering for the scope. - */ - getRequiredOrdering() { - return this.ordering ?? new Ordering(); - } - /** - * Returns the required resolved fields for the scope. - */ - getRequiredResolvedFields() { - const resolvedFields = new Fields(); - for ( - const { - field, - } of this.fields - ) { - if (field.collection) { - resolvedFields.add(field,); - } - } - return resolvedFields; - } - /** - * Returns the set of required physical props for this scope. This is used - * to create the required props for the root node in the optimizer. - */ - getRequiredProps() { - const ordering = this.getRequiredOrdering(); - const resolvedFields = this.getRequiredResolvedFields(); - return new RequiredProps(ordering, resolvedFields,); - } - /** - * Returns a map of the fields in this scope, with their scope names as - * keys. This is used to create the final `QueryResult` with the correct - * field names. - */ - getNamedFields() { - const namedFields = {}; - for ( - const { - name, - field, - } of this.fields - ) { - namedFields[name] = field; - } - return namedFields; - } - /** - * Returns the single field from this scope if it only contains one field. - * Throws an error if there are more than one fields. - */ - getSingleField() { - assert(this.fields.length === 1, 'Scope must contain exactly one field',); - const scopeField = this.fields[0]; - assert(scopeField, 'Field must exist',); - return scopeField.field; - } -}; var Builder = class { constructor(normalizer, query, locale,) { this.normalizer = normalizer; @@ -544890,178 +544903,6 @@ var Memo = class { return node; } }; -var EnforcerNode = class extends RelationalNode {}; -var EnforcerResolve = class extends EnforcerNode { - constructor(input, fields,) { - super(false,); - this.input = input; - this.fields = fields; - __publicField(this, 'inputGroup', this.input.getGroup(),); - } - getHash() { - return calculateHash('EnforcerResolve', this.inputGroup.id, this.fields,); - } - getOutputFields() { - return this.inputGroup.relational.outputFields; - } - canProvideOrdering() { - return true; - } - canProvideResolvedFields(resolvedFields,) { - return resolvedFields.subsetOf(this.fields,); - } - getInputRequiredProps(required,) { - const resolvedFields = new Fields(); - return new RequiredProps(required.ordering, resolvedFields,); - } - optimize(optimizer, required,) { - const inputRequired = this.getInputRequiredProps(required,); - const inputCost = optimizer.optimizeGroup(this.inputGroup, inputRequired,); - return Cost.estimate(0, 100 * KB,).add(inputCost,); - } - getOptimized(required,) { - const inputRequired = this.getInputRequiredProps(required,); - const input = this.inputGroup.getOptimized(inputRequired,); - return new EnforcerResolve(input, this.fields,); - } - *evaluate(context,) { - const input = yield* this.input.evaluate(context,); - assert(this.fields.subsetOf(input.fields,), 'Fields can\'t be resolved',); - const collections = /* @__PURE__ */ new Set(); - for (const field of this.fields) { - assert(field.collection, 'Collection required to resolve field',); - collections.add(field.collection,); - } - for (const tuple of input.tuples) { - for (const field of this.fields) { - const value = tuple.getValue(field,); - if ((value == null ? void 0 : value.type) !== 'richtext') continue; - assert(value.value instanceof RichText, 'Pointer must be wrapped',); - void value.value.resolve(); - } - } - const collectionItems = yield Promise.all( - Array.from(collections,).map(async (collection) => { - const pointers = []; - for (const tuple of input.tuples) { - const pointer = tuple.getPointer(collection,); - if (pointer) pointers.push(pointer,); - } - const items = await collection.data.resolveItems(pointers,); - assert(items.length === pointers.length, 'Invalid number of items',); - return [collection, items,]; - },), - ); - return input.map(input.fields, (tuple) => { - const result = new Tuple(); - result.merge(tuple,); - for (const [collection, items,] of collectionItems) { - const pointer = tuple.getPointer(collection,); - if (!pointer) continue; - const item = items.shift(); - assert(item, 'Item not found',); - assert(item.pointer === pointer, 'Pointer mismatch',); - for (const field of collection.fields) { - const value = field.getValue(item,); - result.addValue(field, value,); - } - } - return result; - },); - } -}; -var collation6 = { - type: 0, - /* CaseInsensitive */ -}; -var EnforcerSort = class extends EnforcerNode { - constructor(input, ordering,) { - super(input.isSynchronous,); - this.input = input; - this.ordering = ordering; - __publicField(this, 'inputGroup', this.input.getGroup(),); - } - getHash() { - return calculateHash('EnforcerSort', this.inputGroup.id, this.ordering,); - } - getOutputFields() { - return this.inputGroup.relational.outputFields; - } - canProvideOrdering(ordering,) { - return ordering.equals(this.ordering,); - } - canProvideResolvedFields() { - return true; - } - getInputRequiredProps(required,) { - const resolvedFields = new Fields(required.resolvedFields,); - for ( - const { - field, - } of this.ordering.fields - ) { - if (field.name === VIRTUAL_INDEX_FIELD) continue; - if (isUndefined(field.collection,)) continue; - resolvedFields.add(field,); - } - const ordering = new Ordering(); - return new RequiredProps(ordering, resolvedFields,); - } - optimize(optimizer, required,) { - const inputRequired = this.getInputRequiredProps(required,); - const inputCost = optimizer.optimizeGroup(this.inputGroup, inputRequired,); - return new Cost(0,).add(inputCost,); - } - getOptimized(required,) { - const inputRequired = this.getInputRequiredProps(required,); - const input = this.inputGroup.getOptimized(inputRequired,); - return new EnforcerSort(input, this.ordering,); - } - *evaluate(context,) { - const input = yield* this.input.evaluate(context,); - return input.sort((leftTuple, rightTuple,) => { - for ( - const { - field, - direction, - } of this.ordering.fields - ) { - const isAscending = direction === 'asc'; - if (field.name === VIRTUAL_INDEX_FIELD) { - const collection = field.collection; - assert(collection, 'Collection required for sorting',); - const leftPointer = leftTuple.getPointer(collection,); - assert(leftPointer, 'Pointer required for sorting',); - const leftItem = { - pointer: leftPointer, - data: {}, - }; - const rightPointer = rightTuple.getPointer(collection,); - assert(rightPointer, 'Pointer required for sorting',); - const rightItem = { - pointer: rightPointer, - data: {}, - }; - const order = collection.data.compareItems(leftItem, rightItem,); - return isAscending ? order : -order; - } - const leftValue = leftTuple.getValue(field,); - const rightValue = rightTuple.getValue(field,); - if (DatabaseValue.equal(leftValue, rightValue, collation6,)) { - continue; - } - if (isNull(leftValue,) || DatabaseValue.lessThan(leftValue, rightValue, collation6,)) { - return isAscending ? -1 : 1; - } - if (isNull(rightValue,) || DatabaseValue.greaterThan(leftValue, rightValue, collation6,)) { - return isAscending ? 1 : -1; - } - throw new Error('Invalid comparison',); - } - return 0; - },); - } -}; var RelationalLimit = class extends RelationalNode { constructor(input, limit, ordering,) { super(input.isSynchronous && limit.isSynchronous,); @@ -545329,7 +545170,7 @@ var ScalarFlatArray = class extends ScalarNode { }; } }; -var collation8 = { +var collation6 = { type: 0, /* CaseInsensitive */ }; @@ -545376,11 +545217,11 @@ var ScalarIn = class extends ScalarNode { },); return { type: 'boolean', - value: DatabaseValue.in(left, right, collation8,), + value: DatabaseValue.in(left, right, collation6,), }; } }; -var collation9 = { +var collation7 = { type: 1, /* CaseSensitive */ }; @@ -545427,7 +545268,7 @@ var ScalarIndexOf = class extends ScalarNode { },); return { type: 'number', - value: DatabaseValue.indexOf(source, target, collation9,), + value: DatabaseValue.indexOf(source, target, collation7,), }; } }; @@ -545491,7 +545332,7 @@ var ScalarNot = class extends ScalarNode { }; } }; -var collation10 = { +var collation8 = { type: 0, /* CaseInsensitive */ }; @@ -545538,7 +545379,7 @@ var ScalarNotIn = class extends ScalarNode { },); return { type: 'boolean', - value: !DatabaseValue.in(left, right, collation10,), + value: !DatabaseValue.in(left, right, collation8,), }; } }; @@ -545889,6 +545730,178 @@ var Normalizer = class { return this.finishScalar(node,); } }; +var EnforcerNode = class extends RelationalNode {}; +var EnforcerResolve = class extends EnforcerNode { + constructor(input, fields,) { + super(false,); + this.input = input; + this.fields = fields; + __publicField(this, 'inputGroup', this.input.getGroup(),); + } + getHash() { + return calculateHash('EnforcerResolve', this.inputGroup.id, this.fields,); + } + getOutputFields() { + return this.inputGroup.relational.outputFields; + } + canProvideOrdering() { + return true; + } + canProvideResolvedFields(resolvedFields,) { + return resolvedFields.subsetOf(this.fields,); + } + getInputRequiredProps(required,) { + const resolvedFields = new Fields(); + return new RequiredProps(required.ordering, resolvedFields,); + } + optimize(optimizer, required,) { + const inputRequired = this.getInputRequiredProps(required,); + const inputCost = optimizer.optimizeGroup(this.inputGroup, inputRequired,); + return Cost.estimate(0, 100 * KB,).add(inputCost,); + } + getOptimized(required,) { + const inputRequired = this.getInputRequiredProps(required,); + const input = this.inputGroup.getOptimized(inputRequired,); + return new EnforcerResolve(input, this.fields,); + } + *evaluate(context,) { + const input = yield* this.input.evaluate(context,); + assert(this.fields.subsetOf(input.fields,), 'Fields can\'t be resolved',); + const collections = /* @__PURE__ */ new Set(); + for (const field of this.fields) { + assert(field.collection, 'Collection required to resolve field',); + collections.add(field.collection,); + } + for (const tuple of input.tuples) { + for (const field of this.fields) { + const value = tuple.getValue(field,); + if ((value == null ? void 0 : value.type) !== 'richtext') continue; + assert(value.value instanceof RichText, 'Pointer must be wrapped',); + void value.value.resolve(); + } + } + const collectionItems = yield Promise.all( + Array.from(collections,).map(async (collection) => { + const pointers = []; + for (const tuple of input.tuples) { + const pointer = tuple.getPointer(collection,); + if (pointer) pointers.push(pointer,); + } + const items = await collection.data.resolveItems(pointers,); + assert(items.length === pointers.length, 'Invalid number of items',); + return [collection, items,]; + },), + ); + return input.map(input.fields, (tuple) => { + const result = new Tuple(); + result.merge(tuple,); + for (const [collection, items,] of collectionItems) { + const pointer = tuple.getPointer(collection,); + if (!pointer) continue; + const item = items.shift(); + assert(item, 'Item not found',); + assert(item.pointer === pointer, 'Pointer mismatch',); + for (const field of collection.fields) { + const value = field.getValue(item,); + result.addValue(field, value,); + } + } + return result; + },); + } +}; +var collation9 = { + type: 0, + /* CaseInsensitive */ +}; +var EnforcerSort = class extends EnforcerNode { + constructor(input, ordering,) { + super(input.isSynchronous,); + this.input = input; + this.ordering = ordering; + __publicField(this, 'inputGroup', this.input.getGroup(),); + } + getHash() { + return calculateHash('EnforcerSort', this.inputGroup.id, this.ordering,); + } + getOutputFields() { + return this.inputGroup.relational.outputFields; + } + canProvideOrdering(ordering,) { + return ordering.equals(this.ordering,); + } + canProvideResolvedFields() { + return true; + } + getInputRequiredProps(required,) { + const resolvedFields = new Fields(required.resolvedFields,); + for ( + const { + field, + } of this.ordering.fields + ) { + if (field.name === VIRTUAL_INDEX_FIELD) continue; + if (isUndefined(field.collection,)) continue; + resolvedFields.add(field,); + } + const ordering = new Ordering(); + return new RequiredProps(ordering, resolvedFields,); + } + optimize(optimizer, required,) { + const inputRequired = this.getInputRequiredProps(required,); + const inputCost = optimizer.optimizeGroup(this.inputGroup, inputRequired,); + return new Cost(0,).add(inputCost,); + } + getOptimized(required,) { + const inputRequired = this.getInputRequiredProps(required,); + const input = this.inputGroup.getOptimized(inputRequired,); + return new EnforcerSort(input, this.ordering,); + } + *evaluate(context,) { + const input = yield* this.input.evaluate(context,); + return input.sort((leftTuple, rightTuple,) => { + for ( + const { + field, + direction, + } of this.ordering.fields + ) { + const isAscending = direction === 'asc'; + if (field.name === VIRTUAL_INDEX_FIELD) { + const collection = field.collection; + assert(collection, 'Collection required for sorting',); + const leftPointer = leftTuple.getPointer(collection,); + assert(leftPointer, 'Pointer required for sorting',); + const leftItem = { + pointer: leftPointer, + data: {}, + }; + const rightPointer = rightTuple.getPointer(collection,); + assert(rightPointer, 'Pointer required for sorting',); + const rightItem = { + pointer: rightPointer, + data: {}, + }; + const order = collection.data.compareItems(leftItem, rightItem,); + return isAscending ? order : -order; + } + const leftValue = leftTuple.getValue(field,); + const rightValue = rightTuple.getValue(field,); + if (DatabaseValue.equal(leftValue, rightValue, collation9,)) { + continue; + } + if (isNull(leftValue,) || DatabaseValue.lessThan(leftValue, rightValue, collation9,)) { + return isAscending ? -1 : 1; + } + if (isNull(rightValue,) || DatabaseValue.greaterThan(leftValue, rightValue, collation9,)) { + return isAscending ? 1 : -1; + } + throw new Error('Invalid comparison',); + } + return 0; + },); + } +}; var Optimizer = class { constructor(query, locale,) { this.query = query; @@ -550784,8 +550797,11 @@ function isEffectKey(key7,) { function createKeyframes(effect,) { const out = {}; for (const key7 in effect) { - if (!isEffectKey(key7,) || isUndefined(effect[key7],)) continue; - out[key7] = [effect[key7], defaultValues2[key7],]; + if (!isEffectKey(key7,)) continue; + const effectValue = effect[key7]; + const defaultValue = defaultValues2[key7]; + if (isUndefined(effectValue,) || isUndefined(defaultValue,)) continue; + out[key7] = [effectValue, defaultValue,]; } return out; } @@ -550811,11 +550827,15 @@ function tokenizeText(text, tokenization = 'character', elements, style,) { children: (_a = word.match(emojiSplitRe,)) == null ? void 0 : _a.map((char, i,) => { const ref = newOverrideableRef(); elements.add(ref,); - return /* @__PURE__ */ jsx('span', { - ref, - style, - children: char, - }, char + i,); + return ( + // biome-ignore lint/suspicious/noArrayIndexKey: We are combining index with char. + /* @__PURE__ */ + jsx('span', { + ref, + style, + children: char, + }, char + i,) + ); },), },), isLastWord ? null : ' ', @@ -550904,7 +550924,9 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) { function useTextEffect(config, ref, preview,) { const elements = useConstant2(() => /* @__PURE__ */ new Set()); const isOnCanvas = useIsOnFramerCanvas(); - const canPlay = preview || !isOnCanvas; + const isOnExport = RenderTarget.current() === RenderTarget.export; + const isOnCanvasOrExport = isOnCanvas || isOnExport; + const canPlay = preview || !isOnCanvasOrExport; const state2 = React2.useRef({ hasMounted: false, hasAnimatedOnce: false, @@ -553854,7 +553876,7 @@ var package_default = { '@types/react-dom': '^18.2.22', '@types/yargs': '^17.0.19', '@typescript-eslint/eslint-plugin': '^8.2.0', - '@typescript-eslint/parser': '^8.19.1', + '@typescript-eslint/parser': '^8.21.0', chalk: '^4.1.2', eslint: '^8.57.0', 'eslint-plugin-framer-studio': 'workspace:*',