@flyo/nitro-astro 2.3.7 → 2.4.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 CHANGED
@@ -120,7 +120,7 @@ const slug = Astro.params.slug ?? "";
120
120
  const config = await useConfig(Astro);
121
121
 
122
122
  if (!config.pages.includes(slug)) {
123
- throw Astro.redirect("/404", 404);
123
+ return Astro.rewrite("/404");
124
124
  }
125
125
 
126
126
  let page;
@@ -129,7 +129,7 @@ try {
129
129
  const pagesApi = usePagesApi();
130
130
  page = await pagesApi.page({ slug });
131
131
  } catch (e) {
132
- throw Astro.redirect("/404", 404);
132
+ return Astro.rewrite("/404");
133
133
  }
134
134
  ---
135
135
 
@@ -474,10 +474,7 @@ try {
474
474
  typeId: 9999,
475
475
  });
476
476
  } catch (e) {
477
- return new Response(e.body, {
478
- status: 404,
479
- statusText: "Entity Not Found",
480
- });
477
+ return Astro.rewrite("/404");
481
478
  }
482
479
  const isProd = import.meta.env.PROD;
483
480
  ---
@@ -47,11 +47,14 @@
47
47
  }
48
48
  };
49
49
  `),n.liveEdit&&t("page",`
50
- import { reload, highlightAndClick } from '@flyo/nitro-js-bridge';
50
+ import { reload, scrollTo, highlightAndClick } from '@flyo/nitro-js-bridge';
51
51
 
52
52
  // Enable pageRefresh handling
53
53
  reload();
54
54
 
55
+ // Enable scrollTo handling
56
+ scrollTo();
57
+
55
58
  // Wire all elements with the 'data-flyo-uid' attribute
56
59
  function wire() {
57
60
  const elements = document.querySelectorAll('[data-flyo-uid]');
@@ -215,7 +215,7 @@ function O(e, n) {
215
215
  slots: e.slots == null ? void 0 : p(e.slots, N)
216
216
  };
217
217
  }
218
- function k(e) {
218
+ function T(e) {
219
219
  return D(e);
220
220
  }
221
221
  function D(e, n) {
@@ -238,7 +238,7 @@ function G(e, n) {
238
238
  primary_language: e.primary_language == null ? void 0 : e.primary_language
239
239
  };
240
240
  }
241
- function I(e) {
241
+ function k(e) {
242
242
  return H(e);
243
243
  }
244
244
  function H(e, n) {
@@ -249,7 +249,7 @@ function H(e, n) {
249
249
  href: e.href == null ? void 0 : e.href,
250
250
  slug: e.slug == null ? void 0 : e.slug,
251
251
  properties: e.properties == null ? void 0 : e.properties,
252
- children: e.children == null ? void 0 : e.children.map(I)
252
+ children: e.children == null ? void 0 : e.children.map(k)
253
253
  };
254
254
  }
255
255
  function z(e) {
@@ -257,7 +257,7 @@ function z(e) {
257
257
  }
258
258
  function V(e, n) {
259
259
  return e == null ? e : {
260
- items: e.items == null ? void 0 : e.items.map(I),
260
+ items: e.items == null ? void 0 : e.items.map(k),
261
261
  uid: e.uid == null ? void 0 : e.uid,
262
262
  identifier: e.identifier == null ? void 0 : e.identifier,
263
263
  label: e.label == null ? void 0 : e.label
@@ -283,7 +283,7 @@ function X(e, n) {
283
283
  name: e.name == null ? void 0 : e.name
284
284
  };
285
285
  }
286
- function T(e) {
286
+ function I(e) {
287
287
  return Y(e);
288
288
  }
289
289
  function Y(e, n) {
@@ -333,8 +333,8 @@ function ie(e, n) {
333
333
  model: e.model == null ? void 0 : e.model,
334
334
  language: e.language == null ? void 0 : e.language,
335
335
  jsonld: e.jsonld == null ? void 0 : e.jsonld,
336
- translation: e.translation == null ? void 0 : e.translation.map(T),
337
- breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(k)
336
+ translation: e.translation == null ? void 0 : e.translation.map(I),
337
+ breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(T)
338
338
  };
339
339
  }
340
340
  function x(e) {
@@ -394,8 +394,8 @@ function ue(e, n) {
394
394
  type: e.type == null ? void 0 : e.type,
395
395
  target: e.target == null ? void 0 : e.target,
396
396
  container: e.container == null ? void 0 : e.container,
397
- breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(k),
398
- translation: e.translation == null ? void 0 : e.translation.map(T)
397
+ breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(T),
398
+ translation: e.translation == null ? void 0 : e.translation.map(I)
399
399
  };
400
400
  }
401
401
  function ce(e) {
@@ -691,7 +691,7 @@ function Ae() {
691
691
  function f() {
692
692
  return Ae().config;
693
693
  }
694
- async function Te(e) {
694
+ async function Ie(e) {
695
695
  return await e.locals.config;
696
696
  }
697
697
  function xe() {
@@ -712,12 +712,12 @@ function Ue() {
712
712
  function Pe() {
713
713
  return new ve(f());
714
714
  }
715
- function ke(e) {
715
+ function Te(e) {
716
716
  return {
717
717
  "data-flyo-uid": e.uid
718
718
  };
719
719
  }
720
- const Fe = ke, Ie = `
720
+ const Fe = Te, ke = `
721
721
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 163.4 88.5">
722
722
  <style type="text/css">
723
723
  .st8{fill:#FFFFFF;}
@@ -777,7 +777,7 @@ function $e(e) {
777
777
  id: "flyo-nitro",
778
778
  name: "Flyo Nitro",
779
779
  //icon: 'lightbulb',
780
- icon: Ie,
780
+ icon: ke,
781
781
  //icon: '<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><ellipse cx="100" cy="60" rx="90" ry="50" fill="#F4A460" /><circle cx="70" cy="45" r="5" fill="white" /><circle cx="90" cy="30" r="5" fill="white" /><circle cx="110" cy="45" r="5" fill="white" /><circle cx="130" cy="30" r="5" fill="white" /><circle cx="150" cy="45" r="5" fill="white" /><path d="M30 90 Q60 75, 90 90 T150 90 Q160 80, 180 90" fill="#228B22" /><rect x="30" y="90" width="140" height="15" fill="#FF6347" /><rect x="30" y="105" width="140" height="15" fill="#FFD700" /><rect x="30" y="120" width="140" height="25" fill="#8B4513" /><ellipse cx="100" cy="160" rx="90" ry="30" fill="#F4A460" /></svg>',
782
782
  entrypoint: "@flyo/nitro-astro/toolbar.ts"
783
783
  }), r({
@@ -824,11 +824,14 @@ function $e(e) {
824
824
  ), n.liveEdit && t(
825
825
  "page",
826
826
  `
827
- import { reload, highlightAndClick } from '@flyo/nitro-js-bridge';
827
+ import { reload, scrollTo, highlightAndClick } from '@flyo/nitro-js-bridge';
828
828
 
829
829
  // Enable pageRefresh handling
830
830
  reload();
831
831
 
832
+ // Enable scrollTo handling
833
+ scrollTo();
834
+
832
835
  // Wire all elements with the 'data-flyo-uid' attribute
833
836
  function wire() {
834
837
  const elements = document.querySelectorAll('[data-flyo-uid]');
@@ -853,9 +856,9 @@ function $e(e) {
853
856
  }
854
857
  export {
855
858
  $e as default,
856
- ke as editable,
859
+ Te as editable,
857
860
  Fe as editableBlock,
858
- Te as useConfig,
861
+ Ie as useConfig,
859
862
  xe as useConfigApi,
860
863
  f as useConfiguration,
861
864
  Se as useEntitiesApi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flyo/nitro-astro",
3
- "version": "2.3.7",
3
+ "version": "2.4.0",
4
4
  "description": "Connecting Flyo Headless Content Hub into your Astro project.",
5
5
  "homepage": "https://dev.flyo.cloud/nitro",
6
6
  "keywords": [
@@ -38,46 +38,91 @@
38
38
  "import": "./components/BlockSlot.ts",
39
39
  "require": "./components/BlockSlot.ts"
40
40
  },
41
+ "./components/BlockSlot.astro": {
42
+ "types": "./components/BlockSlot.ts",
43
+ "import": "./components/BlockSlot.astro",
44
+ "require": "./components/BlockSlot.astro"
45
+ },
41
46
  "./FallbackComponent.astro": {
42
47
  "types": "./components/FallbackComponent.ts",
43
48
  "import": "./components/FallbackComponent.ts",
44
49
  "require": "./components/FallbackComponent.ts"
45
50
  },
51
+ "./components/FallbackComponent.astro": {
52
+ "types": "./components/FallbackComponent.ts",
53
+ "import": "./components/FallbackComponent.astro",
54
+ "require": "./components/FallbackComponent.astro"
55
+ },
46
56
  "./FlyoNitroBlock.astro": {
47
57
  "types": "./components/FlyoNitroBlock.ts",
48
58
  "import": "./components/FlyoNitroBlock.ts",
49
59
  "require": "./components/FlyoNitroBlock.ts"
50
60
  },
61
+ "./components/FlyoNitroBlock.astro": {
62
+ "types": "./components/FlyoNitroBlock.ts",
63
+ "import": "./components/FlyoNitroBlock.astro",
64
+ "require": "./components/FlyoNitroBlock.astro"
65
+ },
51
66
  "./FlyoNitroPage.astro": {
52
67
  "types": "./components/FlyoNitroPage.ts",
53
68
  "import": "./components/FlyoNitroPage.ts",
54
69
  "require": "./components/FlyoNitroPage.ts"
55
70
  },
71
+ "./components/FlyoNitroPage.astro": {
72
+ "types": "./components/FlyoNitroPage.ts",
73
+ "import": "./components/FlyoNitroPage.astro",
74
+ "require": "./components/FlyoNitroPage.astro"
75
+ },
56
76
  "./MetaInfo.astro": {
57
77
  "types": "./components/MetaInfo.ts",
58
78
  "import": "./components/MetaInfo.ts",
59
79
  "require": "./components/MetaInfo.ts"
60
80
  },
81
+ "./components/MetaInfo.astro": {
82
+ "types": "./components/MetaInfo.ts",
83
+ "import": "./components/MetaInfo.astro",
84
+ "require": "./components/MetaInfo.astro"
85
+ },
61
86
  "./MetaInfoEntity.astro": {
62
87
  "types": "./components/MetaInfoEntity.ts",
63
88
  "import": "./components/MetaInfoEntity.ts",
64
89
  "require": "./components/MetaInfoEntity.ts"
65
90
  },
91
+ "./components/MetaInfoEntity.astro": {
92
+ "types": "./components/MetaInfoEntity.ts",
93
+ "import": "./components/MetaInfoEntity.astro",
94
+ "require": "./components/MetaInfoEntity.astro"
95
+ },
66
96
  "./MetaInfoPage.astro": {
67
97
  "types": "./components/MetaInfoPage.ts",
68
98
  "import": "./components/MetaInfoPage.ts",
69
99
  "require": "./components/MetaInfoPage.ts"
70
100
  },
101
+ "./components/MetaInfoPage.astro": {
102
+ "types": "./components/MetaInfoPage.ts",
103
+ "import": "./components/MetaInfoPage.astro",
104
+ "require": "./components/MetaInfoPage.astro"
105
+ },
71
106
  "./FlyoWysiwyg.astro": {
72
107
  "types": "./components/FlyoWysiwyg.ts",
73
108
  "import": "./components/FlyoWysiwyg.ts",
74
109
  "require": "./components/FlyoWysiwyg.ts"
75
110
  },
111
+ "./components/FlyoWysiwyg.astro": {
112
+ "types": "./components/FlyoWysiwyg.ts",
113
+ "import": "./components/FlyoWysiwyg.astro",
114
+ "require": "./components/FlyoWysiwyg.astro"
115
+ },
76
116
  "./DebugInfo.astro": {
77
117
  "types": "./components/DebugInfo.ts",
78
118
  "import": "./components/DebugInfo.ts",
79
119
  "require": "./components/DebugInfo.ts"
80
120
  },
121
+ "./components/DebugInfo.astro": {
122
+ "types": "./components/DebugInfo.ts",
123
+ "import": "./components/DebugInfo.astro",
124
+ "require": "./components/DebugInfo.astro"
125
+ },
81
126
  "./cdn.ts": "./cdn.ts",
82
127
  "./middleware.ts": "./middleware.ts",
83
128
  "./sitemap.ts": "./sitemap.ts",