unframer 2.6.6 → 2.7.1

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/dist/framer.js CHANGED
@@ -14631,7 +14631,7 @@ function steps(numSteps, direction = 'end') {
14631
14631
  return clamp(0, 1, rounded / numSteps);
14632
14632
  };
14633
14633
  }
14634
- // https :https://app.framerstatic.com/framer.PLXHDWID.mjs
14634
+ // https :https://app.framerstatic.com/framer.7SGKTLCE.mjs
14635
14635
  init_chunk_QLPHEVXG();
14636
14636
  const react_11 = __importDefault(require("react"));
14637
14637
  const react_12 = require("react");
@@ -17857,7 +17857,7 @@ function useNavigationTransition(enableAsyncURLUpdates) {
17857
17857
  });
17858
17858
  }), [enableAsyncURLUpdates, monitorNextPaintAfterRender, startNativeSpinner,]);
17859
17859
  }
17860
- function Router({ defaultPageStyle, disableHistory, initialPathVariables, initialRoute, notFoundPage, collectionUtils, routes, initialLocaleId, locales = EMPTY_ARRAY, preserveQueryParams = false, enableAsyncURLUpdates = false, }) {
17860
+ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initialRoute, notFoundPage, collectionUtils, routes, initialLocaleId, locales = EMPTY_ARRAY, preserveQueryParams = false, enableAsyncURLUpdates = false, LayoutTemplate, }) {
17861
17861
  useMarkRouterEffects();
17862
17862
  useReplaceInitialState({
17863
17863
  disabled: disableHistory,
@@ -18059,14 +18059,20 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
18059
18059
  notFoundPage,
18060
18060
  defaultPageStyle,
18061
18061
  forceUpdateKey: dep,
18062
- children: (0, jsx_runtime_1.jsxs)(react_8.Fragment, {
18063
- children: [
18064
- (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.Start, {}),
18065
- pageExistsInCurrentLocale
18066
- ? renderPage(current.page, defaultPageStyle)
18067
- : notFoundPage && renderPage(notFoundPage, defaultPageStyle),
18068
- ],
18069
- }, remountKey),
18062
+ children: (0, jsx_runtime_1.jsx)(WithLayoutTemplate, {
18063
+ LayoutTemplate,
18064
+ routeId: currentRouteId,
18065
+ children: (0, jsx_runtime_1.jsxs)(react_8.Fragment, {
18066
+ children: [
18067
+ (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.Start, {}),
18068
+ pageExistsInCurrentLocale
18069
+ ? renderPage(current.page, LayoutTemplate
18070
+ ? Object.assign(Object.assign({}, defaultPageStyle), { display: 'content' }) : defaultPageStyle)
18071
+ : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
18072
+ notFoundPage && renderPage(notFoundPage, defaultPageStyle),
18073
+ ],
18074
+ }, remountKey),
18075
+ }),
18070
18076
  }),
18071
18077
  (0, jsx_runtime_1.jsx)(TurnOnReactEventHandling, {}),
18072
18078
  (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.End, {}),
@@ -18075,6 +18081,14 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
18075
18081
  }),
18076
18082
  });
18077
18083
  }
18084
+ function WithLayoutTemplate({ LayoutTemplate, routeId, children, }) {
18085
+ if (!LayoutTemplate)
18086
+ return children;
18087
+ return (0, jsx_runtime_1.jsx)(LayoutTemplate, {
18088
+ routeId,
18089
+ children,
18090
+ });
18091
+ }
18078
18092
  function scrollElementIntoView(element, smoothScroll) {
18079
18093
  const scrollIntoViewOptions = smoothScroll
18080
18094
  ? {
@@ -34447,7 +34461,7 @@ function createHook(forwardedRef) {
34447
34461
  let preventNextCall = false;
34448
34462
  function cloneChildrenWithPropsAndRef(children, props) {
34449
34463
  if (preventNextCall) {
34450
- throw new ReferenceError('useCloneChildrenWithPropsAndRef: You should not call cloneChildrenWithPropsAndRef more than once during the render cycle.');
34464
+ ;
34451
34465
  }
34452
34466
  preventNextCall = true;
34453
34467
  if (React2.Children.count(children) > 1 && forwardedRef) {
@@ -40231,6 +40245,16 @@ var Ordering = class {
40231
40245
  return false;
40232
40246
  return this.getHash() === other.getHash();
40233
40247
  }
40248
+ providedByFields(fields) {
40249
+ for (const { field, } of this.fields) {
40250
+ if (fields.has(field))
40251
+ continue;
40252
+ if (field.name === VIRTUAL_INDEX_FIELD)
40253
+ continue;
40254
+ return false;
40255
+ }
40256
+ return true;
40257
+ }
40234
40258
  };
40235
40259
  var Scope = class {
40236
40260
  constructor(parent) {
@@ -42736,13 +42760,17 @@ var Normalizer = class {
42736
42760
  return this.newRelationalLeftJoin(right, left, constraint);
42737
42761
  }
42738
42762
  newRelationalFilter(input, predicate) {
42739
- if (input instanceof RelationalLeftJoin && predicate.referencedFields.subsetOf(input.leftGroup.relational.outputFields)) {
42740
- const left = this.newRelationalFilter(input.left, predicate);
42741
- return this.newRelationalLeftJoin(left, input.right, input.constraint);
42742
- }
42743
- if (input instanceof RelationalRightJoin && predicate.referencedFields.subsetOf(input.rightGroup.relational.outputFields)) {
42744
- const right = this.newRelationalFilter(input.right, predicate);
42745
- return this.newRelationalLeftJoin(input.left, right, input.constraint);
42763
+ if (input instanceof RelationalLeftJoin &&
42764
+ // Check that the predicate doesn't depend on any joined field.
42765
+ predicate.referencedFields.subsetOf(input.leftGroup.relational.outputFields)) {
42766
+ const pushedFilter = this.newRelationalFilter(input.left, predicate);
42767
+ return this.newRelationalLeftJoin(pushedFilter, input.right, input.constraint);
42768
+ }
42769
+ if (input instanceof RelationalRightJoin &&
42770
+ // Check that the predicate doesn't depend on any joined field.
42771
+ predicate.referencedFields.subsetOf(input.rightGroup.relational.outputFields)) {
42772
+ const pushedFilter = this.newRelationalFilter(input.right, predicate);
42773
+ return this.newRelationalLeftJoin(input.left, pushedFilter, input.constraint);
42746
42774
  }
42747
42775
  const node = new RelationalFilter(input, predicate);
42748
42776
  return this.finishRelational(node);
@@ -42752,6 +42780,14 @@ var Normalizer = class {
42752
42780
  return this.finishRelational(node);
42753
42781
  }
42754
42782
  newRelationalLimit(input, limit, ordering) {
42783
+ if (input instanceof RelationalProject &&
42784
+ // Check that the limit doesn't depend on any projected field.
42785
+ limit.referencedFields.subsetOf(input.inputGroup.relational.outputFields) &&
42786
+ // Check that the ordering doesn't depend on any projected field.
42787
+ ordering.providedByFields(input.inputGroup.relational.outputFields)) {
42788
+ const pushedLimit = this.newRelationalLimit(input.input, limit, ordering);
42789
+ return this.newRelationalProject(pushedLimit, input.projections, input.passthrough);
42790
+ }
42755
42791
  const node = new RelationalLimit(input, limit, ordering);
42756
42792
  return this.finishRelational(node);
42757
42793
  }
@@ -50387,7 +50423,7 @@ var package_default = {
50387
50423
  react: '^18.2.0',
50388
50424
  'react-dom': '^18.2.0',
50389
50425
  semver: '^7.5.2',
50390
- typescript: '^5.6.2',
50426
+ typescript: '^5.7.2',
50391
50427
  yargs: '^17.6.2',
50392
50428
  },
50393
50429
  peerDependencies: {