@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260422085209 → 0.8.1-dev.20260422124624

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  HlsPlayer_default
4
- } from "./chunk-LIMBWZ6H.mjs";
4
+ } from "./chunk-NTZ3IUOL.mjs";
5
5
  export {
6
6
  HlsPlayer_default as default
7
7
  };
@@ -109,6 +109,7 @@ var HlsPlayer = React.memo(
109
109
  {
110
110
  ref: videoRef,
111
111
  className: "w-full h-full object-contain",
112
+ poster: fallbackPoster,
112
113
  controls: showControls && (isMobile || isPlaying),
113
114
  muted: playOptions === "autoplay" || playOptions === "playOnHover",
114
115
  autoPlay: playOptions === "autoplay",
@@ -126,6 +127,25 @@ var HlsPlayer = React.memo(
126
127
  ))
127
128
  }
128
129
  ),
130
+ !isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ jsxs(
131
+ "picture",
132
+ {
133
+ className: `absolute inset-0 transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`,
134
+ children: [
135
+ posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ jsx("source", { media, srcSet: src }, i)),
136
+ /* @__PURE__ */ jsx(
137
+ "img",
138
+ {
139
+ src: fallbackPoster,
140
+ width: intrinsicWidth,
141
+ height: intrinsicHeight,
142
+ alt: "poster",
143
+ className: "w-full h-full object-cover"
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
129
149
  !isMobile && !isPlaying && /* @__PURE__ */ jsx(
130
150
  "div",
131
151
  {
package/dist/index.js CHANGED
@@ -386,6 +386,7 @@ var init_HlsPlayer = __esm({
386
386
  {
387
387
  ref: videoRef,
388
388
  className: "w-full h-full object-contain",
389
+ poster: fallbackPoster,
389
390
  controls: showControls && (isMobile || isPlaying),
390
391
  muted: playOptions === "autoplay" || playOptions === "playOnHover",
391
392
  autoPlay: playOptions === "autoplay",
@@ -403,6 +404,25 @@ var init_HlsPlayer = __esm({
403
404
  ))
404
405
  }
405
406
  ),
407
+ !isMobile && playOptions === "playOnHover" && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
408
+ "picture",
409
+ {
410
+ className: `absolute inset-0 transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`,
411
+ children: [
412
+ posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("source", { media, srcSet: src }, i)),
413
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
414
+ "img",
415
+ {
416
+ src: fallbackPoster,
417
+ width: intrinsicWidth,
418
+ height: intrinsicHeight,
419
+ alt: "poster",
420
+ className: "w-full h-full object-cover"
421
+ }
422
+ )
423
+ ]
424
+ }
425
+ ),
406
426
  !isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
407
427
  "div",
408
428
  {
@@ -1166,15 +1186,12 @@ var timeZoneAbbreviations = {
1166
1186
  // src/components/controls/view/DateView.tsx
1167
1187
  var import_jsx_runtime2 = require("react/jsx-runtime");
1168
1188
  var DateView = (props) => {
1169
- const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
1170
1189
  const getTimeZoneAbbreviation = (timeZone) => {
1171
1190
  return timeZoneAbbreviations[timeZone] || timeZone;
1172
1191
  };
1173
1192
  const getRelativeTime = (dateString) => {
1174
1193
  const now = /* @__PURE__ */ new Date();
1175
- const date = new Date(
1176
- dateString.includes("Z") ? dateString : dateString + "Z"
1177
- );
1194
+ const date = /* @__PURE__ */ new Date(dateString + "Z");
1178
1195
  const diffMs = now.getTime() - date.getTime();
1179
1196
  const diffSec = Math.floor(diffMs / 1e3);
1180
1197
  const diffMin = Math.floor(diffSec / 60);
@@ -1185,19 +1202,48 @@ var DateView = (props) => {
1185
1202
  if (diffHr < 24) return `${diffHr} hour${diffHr > 1 ? "s" : ""} ago`;
1186
1203
  if (diffDay < 7) return `${diffDay} day${diffDay > 1 ? "s" : ""} ago`;
1187
1204
  return new Intl.DateTimeFormat("en", {
1188
- timeZone: userTimeZone,
1189
1205
  day: "2-digit",
1190
1206
  month: "short",
1191
1207
  year: "numeric"
1192
1208
  }).format(date);
1193
1209
  };
1210
+ console.log("DateView props:", props);
1211
+ const parseAndFormatDate = (dateString, format) => {
1212
+ const parsedDate = /* @__PURE__ */ new Date(dateString + "Z");
1213
+ if (format === "relative") {
1214
+ return getRelativeTime(dateString);
1215
+ }
1216
+ switch (props.controlType) {
1217
+ case "date":
1218
+ return new Intl.DateTimeFormat("en", {
1219
+ day: "2-digit",
1220
+ month: "short",
1221
+ year: "numeric"
1222
+ }).format(parsedDate);
1223
+ case "time":
1224
+ return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(Intl.DateTimeFormat().resolvedOptions().timeZone)} (${getTimePeriod(parsedDate)})`;
1225
+ default:
1226
+ return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
1227
+ day: "2-digit",
1228
+ month: "short",
1229
+ year: "numeric",
1230
+ hour: "2-digit",
1231
+ minute: "2-digit"
1232
+ }).format(parsedDate) : new Intl.DateTimeFormat("en", {
1233
+ day: "2-digit",
1234
+ month: "short",
1235
+ year: "numeric",
1236
+ hour: "2-digit",
1237
+ minute: "2-digit",
1238
+ second: "2-digit"
1239
+ }).format(parsedDate);
1240
+ }
1241
+ };
1194
1242
  const formatTime = (date) => {
1195
1243
  return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
1196
- timeZone: userTimeZone,
1197
1244
  hour: "2-digit",
1198
1245
  minute: "2-digit"
1199
1246
  }).format(date) : new Intl.DateTimeFormat("en", {
1200
- timeZone: userTimeZone,
1201
1247
  hour: "2-digit",
1202
1248
  minute: "2-digit",
1203
1249
  second: "2-digit"
@@ -1214,55 +1260,19 @@ var DateView = (props) => {
1214
1260
  if (hours >= 22 || hours < 5) return "Night";
1215
1261
  return "Late Night";
1216
1262
  };
1217
- const parseAndFormatDate = (dateString, format) => {
1218
- if (!dateString) return "";
1219
- if (format === "relative") {
1220
- return getRelativeTime(dateString);
1221
- }
1222
- const parsedDate = new Date(
1223
- dateString.includes("Z") ? dateString : dateString + "Z"
1224
- );
1225
- if (props.controlType === "date") {
1226
- return new Intl.DateTimeFormat("en", {
1227
- timeZone: userTimeZone,
1228
- day: "2-digit",
1229
- month: "short",
1230
- year: "numeric"
1231
- }).format(parsedDate);
1232
- }
1233
- if (props.controlType === "time") {
1234
- return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(
1235
- userTimeZone
1236
- )} (${getTimePeriod(parsedDate)})`;
1237
- }
1238
- return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
1239
- timeZone: userTimeZone,
1240
- day: "2-digit",
1241
- month: "short",
1242
- year: "numeric",
1243
- hour: "2-digit",
1244
- minute: "2-digit"
1245
- }).format(parsedDate) : new Intl.DateTimeFormat("en", {
1246
- timeZone: userTimeZone,
1247
- day: "2-digit",
1248
- month: "short",
1249
- year: "numeric",
1250
- hour: "2-digit",
1251
- minute: "2-digit",
1252
- second: "2-digit"
1253
- }).format(parsedDate);
1254
- };
1255
1263
  let localDateTime = "";
1256
1264
  let timeZoneAbbreviation = "";
1257
1265
  try {
1258
1266
  localDateTime = parseAndFormatDate(props.value, props.format);
1259
- timeZoneAbbreviation = getTimeZoneAbbreviation(userTimeZone);
1267
+ timeZoneAbbreviation = getTimeZoneAbbreviation(
1268
+ Intl.DateTimeFormat().resolvedOptions().timeZone
1269
+ );
1260
1270
  } catch (error) {
1261
1271
  console.error("Error parsing date:", props.value, error);
1262
1272
  }
1263
1273
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "inline-flex flex-wrap gap-1", children: [
1264
1274
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: localDateTime }),
1265
- !props.format && props.controlType !== "date" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: timeZoneAbbreviation })
1275
+ !props.format && props.controlType != "date" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: timeZoneAbbreviation })
1266
1276
  ] }) });
1267
1277
  };
1268
1278
  var DateView_default = DateView;
@@ -5157,7 +5167,6 @@ var ImageGalleryNode = (props) => {
5157
5167
  (img) => !resolveImageUrl(img.imageUrl).endsWith(".m3u8")
5158
5168
  );
5159
5169
  const hlsSources = [
5160
- // Constrained sources in breakpoint order (narrowest first).
5161
5170
  ...DEVICE_ORDER.flatMap((deviceKey) => {
5162
5171
  const img = hlsImages.find((i) => i.device === deviceKey);
5163
5172
  if (!img) return [];
@@ -5167,7 +5176,6 @@ var ImageGalleryNode = (props) => {
5167
5176
  const posterUrl = resolvePosterUrl(img.posterUrl);
5168
5177
  return [{ src, ...media ? { media } : {}, ...posterUrl ? { posterUrl } : {} }];
5169
5178
  }),
5170
- // Unconstrained fallback(s) — no media attr, always matches.
5171
5179
  ...hlsImages.filter((img) => !img.device).map((img) => {
5172
5180
  const src = resolveImageUrl(img.imageUrl);
5173
5181
  const posterUrl = resolvePosterUrl(img.posterUrl);
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HlsPlayer_default
3
- } from "./chunk-LIMBWZ6H.mjs";
3
+ } from "./chunk-NTZ3IUOL.mjs";
4
4
  import {
5
5
  Button_default,
6
6
  ServiceClient_default,
@@ -162,15 +162,12 @@ var timeZoneAbbreviations = {
162
162
  // src/components/controls/view/DateView.tsx
163
163
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
164
164
  var DateView = (props) => {
165
- const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
166
165
  const getTimeZoneAbbreviation = (timeZone) => {
167
166
  return timeZoneAbbreviations[timeZone] || timeZone;
168
167
  };
169
168
  const getRelativeTime = (dateString) => {
170
169
  const now = /* @__PURE__ */ new Date();
171
- const date = new Date(
172
- dateString.includes("Z") ? dateString : dateString + "Z"
173
- );
170
+ const date = /* @__PURE__ */ new Date(dateString + "Z");
174
171
  const diffMs = now.getTime() - date.getTime();
175
172
  const diffSec = Math.floor(diffMs / 1e3);
176
173
  const diffMin = Math.floor(diffSec / 60);
@@ -181,19 +178,48 @@ var DateView = (props) => {
181
178
  if (diffHr < 24) return `${diffHr} hour${diffHr > 1 ? "s" : ""} ago`;
182
179
  if (diffDay < 7) return `${diffDay} day${diffDay > 1 ? "s" : ""} ago`;
183
180
  return new Intl.DateTimeFormat("en", {
184
- timeZone: userTimeZone,
185
181
  day: "2-digit",
186
182
  month: "short",
187
183
  year: "numeric"
188
184
  }).format(date);
189
185
  };
186
+ console.log("DateView props:", props);
187
+ const parseAndFormatDate = (dateString, format) => {
188
+ const parsedDate = /* @__PURE__ */ new Date(dateString + "Z");
189
+ if (format === "relative") {
190
+ return getRelativeTime(dateString);
191
+ }
192
+ switch (props.controlType) {
193
+ case "date":
194
+ return new Intl.DateTimeFormat("en", {
195
+ day: "2-digit",
196
+ month: "short",
197
+ year: "numeric"
198
+ }).format(parsedDate);
199
+ case "time":
200
+ return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(Intl.DateTimeFormat().resolvedOptions().timeZone)} (${getTimePeriod(parsedDate)})`;
201
+ default:
202
+ return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
203
+ day: "2-digit",
204
+ month: "short",
205
+ year: "numeric",
206
+ hour: "2-digit",
207
+ minute: "2-digit"
208
+ }).format(parsedDate) : new Intl.DateTimeFormat("en", {
209
+ day: "2-digit",
210
+ month: "short",
211
+ year: "numeric",
212
+ hour: "2-digit",
213
+ minute: "2-digit",
214
+ second: "2-digit"
215
+ }).format(parsedDate);
216
+ }
217
+ };
190
218
  const formatTime = (date) => {
191
219
  return date.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
192
- timeZone: userTimeZone,
193
220
  hour: "2-digit",
194
221
  minute: "2-digit"
195
222
  }).format(date) : new Intl.DateTimeFormat("en", {
196
- timeZone: userTimeZone,
197
223
  hour: "2-digit",
198
224
  minute: "2-digit",
199
225
  second: "2-digit"
@@ -210,55 +236,19 @@ var DateView = (props) => {
210
236
  if (hours >= 22 || hours < 5) return "Night";
211
237
  return "Late Night";
212
238
  };
213
- const parseAndFormatDate = (dateString, format) => {
214
- if (!dateString) return "";
215
- if (format === "relative") {
216
- return getRelativeTime(dateString);
217
- }
218
- const parsedDate = new Date(
219
- dateString.includes("Z") ? dateString : dateString + "Z"
220
- );
221
- if (props.controlType === "date") {
222
- return new Intl.DateTimeFormat("en", {
223
- timeZone: userTimeZone,
224
- day: "2-digit",
225
- month: "short",
226
- year: "numeric"
227
- }).format(parsedDate);
228
- }
229
- if (props.controlType === "time") {
230
- return `${formatTime(parsedDate)} ${getTimeZoneAbbreviation(
231
- userTimeZone
232
- )} (${getTimePeriod(parsedDate)})`;
233
- }
234
- return parsedDate.getSeconds() === 0 ? new Intl.DateTimeFormat("en", {
235
- timeZone: userTimeZone,
236
- day: "2-digit",
237
- month: "short",
238
- year: "numeric",
239
- hour: "2-digit",
240
- minute: "2-digit"
241
- }).format(parsedDate) : new Intl.DateTimeFormat("en", {
242
- timeZone: userTimeZone,
243
- day: "2-digit",
244
- month: "short",
245
- year: "numeric",
246
- hour: "2-digit",
247
- minute: "2-digit",
248
- second: "2-digit"
249
- }).format(parsedDate);
250
- };
251
239
  let localDateTime = "";
252
240
  let timeZoneAbbreviation = "";
253
241
  try {
254
242
  localDateTime = parseAndFormatDate(props.value, props.format);
255
- timeZoneAbbreviation = getTimeZoneAbbreviation(userTimeZone);
243
+ timeZoneAbbreviation = getTimeZoneAbbreviation(
244
+ Intl.DateTimeFormat().resolvedOptions().timeZone
245
+ );
256
246
  } catch (error) {
257
247
  console.error("Error parsing date:", props.value, error);
258
248
  }
259
249
  return /* @__PURE__ */ jsx2(React2.Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-wrap gap-1", children: [
260
250
  /* @__PURE__ */ jsx2("span", { children: localDateTime }),
261
- !props.format && props.controlType !== "date" && /* @__PURE__ */ jsx2("span", { children: timeZoneAbbreviation })
251
+ !props.format && props.controlType != "date" && /* @__PURE__ */ jsx2("span", { children: timeZoneAbbreviation })
262
252
  ] }) });
263
253
  };
264
254
  var DateView_default = DateView;
@@ -2638,7 +2628,7 @@ var DeviceAssetSelector_default = DeviceAssetSelector;
2638
2628
 
2639
2629
  // src/components/pageRenderingEngine/nodes/ImageNode.tsx
2640
2630
  import { Fragment as Fragment3, jsx as jsx39 } from "react/jsx-runtime";
2641
- var HlsPlayer = dynamic(() => import("./HlsPlayer-FCDNZAZ4.mjs"), {
2631
+ var HlsPlayer = dynamic(() => import("./HlsPlayer-KOTCX7MY.mjs"), {
2642
2632
  ssr: false
2643
2633
  });
2644
2634
  var getNestedValue = (obj, path) => {
@@ -4107,7 +4097,7 @@ var Pagination_default = Pagination;
4107
4097
  // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
4108
4098
  import dynamic5 from "next/dynamic";
4109
4099
  import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
4110
- var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-FCDNZAZ4.mjs"), { ssr: false });
4100
+ var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-KOTCX7MY.mjs"), { ssr: false });
4111
4101
  var deviceToMediaQuery = (device) => {
4112
4102
  switch (device) {
4113
4103
  case "sm":
@@ -4149,7 +4139,6 @@ var ImageGalleryNode = (props) => {
4149
4139
  (img) => !resolveImageUrl(img.imageUrl).endsWith(".m3u8")
4150
4140
  );
4151
4141
  const hlsSources = [
4152
- // Constrained sources in breakpoint order (narrowest first).
4153
4142
  ...DEVICE_ORDER.flatMap((deviceKey) => {
4154
4143
  const img = hlsImages.find((i) => i.device === deviceKey);
4155
4144
  if (!img) return [];
@@ -4159,7 +4148,6 @@ var ImageGalleryNode = (props) => {
4159
4148
  const posterUrl = resolvePosterUrl(img.posterUrl);
4160
4149
  return [{ src, ...media ? { media } : {}, ...posterUrl ? { posterUrl } : {} }];
4161
4150
  }),
4162
- // Unconstrained fallback(s) — no media attr, always matches.
4163
4151
  ...hlsImages.filter((img) => !img.device).map((img) => {
4164
4152
  const src = resolveImageUrl(img.imageUrl);
4165
4153
  const posterUrl = resolvePosterUrl(img.posterUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260422085209",
3
+ "version": "0.8.1-dev.20260422124624",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",