@websolutespa/bom-next 3.0.2 → 4.0.0-next.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/CHANGELOG.md +17 -7
- package/dist/_virtual/{_rolldown/runtime.js → rolldown_runtime.js} +7 -4
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +17 -6
- package/dist/client/client.js.map +1 -1
- package/dist/client/extra.d.ts +3 -3
- package/dist/client/extra.d.ts.map +1 -1
- package/dist/client/extra.js +10 -5
- package/dist/client/extra.js.map +1 -1
- package/dist/client/label.d.ts.map +1 -1
- package/dist/client/label.js +10 -5
- package/dist/client/label.js.map +1 -1
- package/dist/client/layout.d.ts +3 -3
- package/dist/client/layout.d.ts.map +1 -1
- package/dist/client/layout.js +10 -5
- package/dist/client/layout.js.map +1 -1
- package/dist/client/local.collection.d.ts.map +1 -1
- package/dist/client/local.collection.js +4 -2
- package/dist/client/local.collection.js.map +1 -1
- package/dist/client/metadata.d.ts +3 -3
- package/dist/client/metadata.d.ts.map +1 -1
- package/dist/client/metadata.js +48 -40
- package/dist/client/metadata.js.map +1 -1
- package/dist/client/page.d.ts +3 -3
- package/dist/client/page.d.ts.map +1 -1
- package/dist/client/page.js +10 -5
- package/dist/client/page.js.map +1 -1
- package/dist/client/useApi.d.ts +7 -7
- package/dist/client/useApi.d.ts.map +1 -1
- package/dist/client/useApi.js +2 -1
- package/dist/client/useApi.js.map +1 -1
- package/dist/client/useCollectionApi.d.ts +6 -6
- package/dist/client/useCollectionApi.d.ts.map +1 -1
- package/dist/client/useCollectionApi.js +4 -2
- package/dist/client/useCollectionApi.js.map +1 -1
- package/dist/client/useExtra.d.ts.map +1 -1
- package/dist/client/useExtra.js +5 -2
- package/dist/client/useExtra.js.map +1 -1
- package/dist/client/useHttp.d.ts.map +1 -1
- package/dist/client/useHttp.js +9 -6
- package/dist/client/useHttp.js.map +1 -1
- package/dist/client/useLabel.d.ts.map +1 -1
- package/dist/client/useLabel.js +5 -2
- package/dist/client/useLabel.js.map +1 -1
- package/dist/client/useLayout.d.ts.map +1 -1
- package/dist/client/useLayout.js +5 -2
- package/dist/client/useLayout.js.map +1 -1
- package/dist/client/useLink.d.ts.map +1 -1
- package/dist/client/useLink.js +7 -3
- package/dist/client/useLink.js.map +1 -1
- package/dist/client/useMetaData.d.ts.map +1 -1
- package/dist/client/useMetaData.js +5 -2
- package/dist/client/useMetaData.js.map +1 -1
- package/dist/client/usePage.d.ts.map +1 -1
- package/dist/client/usePage.js +5 -2
- package/dist/client/usePage.js.map +1 -1
- package/dist/client/useUser.d.ts.map +1 -1
- package/dist/client/useUser.js +5 -2
- package/dist/client/useUser.js.map +1 -1
- package/dist/client/user.d.ts.map +1 -1
- package/dist/client/user.js +17 -11
- package/dist/client/user.js.map +1 -1
- package/dist/exports/client.js +2 -1
- package/dist/exports/instrumentation.js +2 -1
- package/dist/exports/proxy.js +2 -1
- package/dist/exports/server.js +2 -1
- package/dist/index.js +2 -1
- package/dist/instrumentation/client.d.ts.map +1 -1
- package/dist/instrumentation/client.js +2 -1
- package/dist/instrumentation/client.js.map +1 -1
- package/dist/instrumentation/sentry/capture.requestError.js +4 -1
- package/dist/instrumentation/sentry/capture.requestError.js.map +1 -1
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js +2 -1
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js.map +1 -1
- package/dist/instrumentation/sentry/config.client.js +10 -2
- package/dist/instrumentation/sentry/config.client.js.map +1 -0
- package/dist/instrumentation/sentry/config.edge.js +10 -2
- package/dist/instrumentation/sentry/config.edge.js.map +1 -0
- package/dist/instrumentation/sentry/config.server.js +10 -2
- package/dist/instrumentation/sentry/config.server.js.map +1 -0
- package/dist/instrumentation/server.d.ts.map +1 -1
- package/dist/instrumentation/server.js +8 -5
- package/dist/instrumentation/server.js.map +1 -1
- package/dist/instrumentation/types.d.ts.map +1 -1
- package/dist/lib/breadcrumb.d.ts.map +1 -1
- package/dist/lib/breadcrumb.js +6 -1
- package/dist/lib/breadcrumb.js.map +1 -1
- package/dist/lib/const.d.ts.map +1 -1
- package/dist/lib/const.js +1 -1
- package/dist/lib/const.js.map +1 -1
- package/dist/lib/http.d.ts.map +1 -1
- package/dist/lib/http.js +6 -3
- package/dist/lib/http.js.map +1 -1
- package/dist/lib/label.d.ts.map +1 -1
- package/dist/lib/label.js +4 -3
- package/dist/lib/label.js.map +1 -1
- package/dist/lib/layout.defaults.d.ts.map +1 -1
- package/dist/lib/layout.defaults.js +1 -1
- package/dist/lib/layout.defaults.js.map +1 -1
- package/dist/lib/link.d.ts.map +1 -1
- package/dist/lib/link.js +2 -1
- package/dist/lib/link.js.map +1 -1
- package/dist/lib/meta-data.d.ts.map +1 -1
- package/dist/lib/open-graph.d.ts.map +1 -1
- package/dist/lib/pagination.d.ts.map +1 -1
- package/dist/lib/pagination.js +4 -2
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/route.d.ts.map +1 -1
- package/dist/lib/route.js +9 -3
- package/dist/lib/route.js.map +1 -1
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/store.js +31 -31
- package/dist/lib/store.js.map +1 -1
- package/dist/lib/structured-data.d.ts.map +1 -1
- package/dist/lib/twitter-card.d.ts.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +3 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/mock.d.ts.map +1 -1
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js +3 -2
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js.map +1 -1
- package/dist/node_modules/deepmerge/dist/cjs.js +17 -9
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -1
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js +2 -2
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js.map +1 -1
- package/dist/node_modules/dom-serializer/lib/esm/index.js +10 -15
- package/dist/node_modules/dom-serializer/lib/esm/index.js.map +1 -1
- package/dist/node_modules/domelementtype/lib/esm/index.js +12 -12
- package/dist/node_modules/domelementtype/lib/esm/index.js.map +1 -1
- package/dist/node_modules/domhandler/lib/esm/index.js +4 -3
- package/dist/node_modules/domhandler/lib/esm/index.js.map +1 -1
- package/dist/node_modules/domhandler/lib/esm/node.js +8 -7
- package/dist/node_modules/domhandler/lib/esm/node.js.map +1 -1
- package/dist/node_modules/entities/lib/esm/decode.js +33 -32
- package/dist/node_modules/entities/lib/esm/decode.js.map +1 -1
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js +5 -5
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -1
- package/dist/node_modules/entities/lib/esm/escape.js +14 -6
- package/dist/node_modules/entities/lib/esm/escape.js.map +1 -1
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js +2 -2
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -1
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js +2 -2
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -1
- package/dist/node_modules/html-to-text/lib/html-to-text.js +45 -33
- package/dist/node_modules/html-to-text/lib/html-to-text.js.map +1 -1
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js +25 -25
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js.map +1 -1
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js +76 -73
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +1 -1
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js +4 -3
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js.map +1 -1
- package/dist/node_modules/leac/lib/leac.js +72 -72
- package/dist/node_modules/leac/lib/leac.js.map +1 -1
- package/dist/node_modules/parseley/lib/parseley.js +37 -33
- package/dist/node_modules/parseley/lib/parseley.js.map +1 -1
- package/dist/node_modules/peberminta/lib/core.js +4 -4
- package/dist/node_modules/peberminta/lib/core.js.map +1 -1
- package/dist/node_modules/selderee/lib/selderee.js +16 -10
- package/dist/node_modules/selderee/lib/selderee.js.map +1 -1
- package/dist/proxy/protected-route.d.ts.map +1 -1
- package/dist/proxy/protected-route.js +11 -6
- package/dist/proxy/protected-route.js.map +1 -1
- package/dist/proxy/proxy.d.ts.map +1 -1
- package/dist/proxy/proxy.js +17 -2
- package/dist/proxy/proxy.js.map +1 -1
- package/dist/proxy/route-auto-detection.d.ts.map +1 -1
- package/dist/proxy/route-auto-detection.js +26 -14
- package/dist/proxy/route-auto-detection.js.map +1 -1
- package/dist/proxy/route-proxy.d.ts.map +1 -1
- package/dist/proxy/route-proxy.js +22 -5
- package/dist/proxy/route-proxy.js.map +1 -1
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/context.js +20 -2
- package/dist/server/context.js.map +1 -1
- package/dist/server/handlers/auth.handler.d.ts.map +1 -1
- package/dist/server/handlers/auth.handler.js +4 -2
- package/dist/server/handlers/auth.handler.js.map +1 -1
- package/dist/server/handlers/captions.handler.d.ts.map +1 -1
- package/dist/server/handlers/captions.handler.js +4 -2
- package/dist/server/handlers/captions.handler.js.map +1 -1
- package/dist/server/handlers/collection.handler.d.ts.map +1 -1
- package/dist/server/handlers/collection.handler.js +2 -1
- package/dist/server/handlers/collection.handler.js.map +1 -1
- package/dist/server/handlers/error-response.js +6 -2
- package/dist/server/handlers/error-response.js.map +1 -1
- package/dist/server/handlers/index.handler.d.ts.map +1 -1
- package/dist/server/handlers/index.handler.js +2 -1
- package/dist/server/handlers/index.handler.js.map +1 -1
- package/dist/server/handlers/preview.handler.d.ts.map +1 -1
- package/dist/server/handlers/preview.handler.js +6 -3
- package/dist/server/handlers/preview.handler.js.map +1 -1
- package/dist/server/handlers/registry.handler.d.ts.map +1 -1
- package/dist/server/handlers/registry.handler.js +14 -9
- package/dist/server/handlers/registry.handler.js.map +1 -1
- package/dist/server/handlers/route.handler.d.ts.map +1 -1
- package/dist/server/handlers/route.handler.js +12 -3
- package/dist/server/handlers/route.handler.js.map +1 -1
- package/dist/server/handlers/sitemap.handler.d.ts.map +1 -1
- package/dist/server/handlers/sitemap.handler.js +12 -9
- package/dist/server/handlers/sitemap.handler.js.map +1 -1
- package/dist/server/handlers/static-params.handler.d.ts.map +1 -1
- package/dist/server/handlers/static-params.handler.js +13 -8
- package/dist/server/handlers/static-params.handler.js.map +1 -1
- package/dist/server/handlers/vars.handler.d.ts.map +1 -1
- package/dist/server/handlers/vars.handler.js +5 -4
- package/dist/server/handlers/vars.handler.js.map +1 -1
- package/dist/server/layout.js +34 -12
- package/dist/server/layout.js.map +1 -1
- package/dist/server/lazy.d.ts.map +1 -1
- package/dist/server/lazy.js +5 -2
- package/dist/server/lazy.js.map +1 -1
- package/dist/server/local-api.d.ts.map +1 -1
- package/dist/server/local-api.js +12 -6
- package/dist/server/local-api.js.map +1 -1
- package/dist/server/metadata.d.ts.map +1 -1
- package/dist/server/metadata.js +5 -1
- package/dist/server/metadata.js.map +1 -1
- package/dist/server/mixer-payload.d.ts +1 -1
- package/dist/server/mixer-payload.d.ts.map +1 -1
- package/dist/server/mixer.d.ts.map +1 -1
- package/dist/server/mixer.js +183 -57
- package/dist/server/mixer.js.map +1 -1
- package/dist/server/page.d.ts.map +1 -1
- package/dist/server/page.js +15 -4
- package/dist/server/page.js.map +1 -1
- package/dist/server/utils.d.ts.map +1 -1
- package/dist/server/utils.js +4 -2
- package/dist/server/utils.js.map +1 -1
- package/dist/server/utmz.d.ts.map +1 -1
- package/dist/server/utmz.js +1 -1
- package/dist/server/utmz.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/lib/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","names":[],"sources":["../../src/lib/route.ts"],"sourcesContent":["import { asCategoryId, findRouteOfCategory, ICategory, IRoute, IRouteLink, localize } from '@websolutespa/bom-core';\r\n\r\nexport function getRouteLinkCategory(\r\n locale: string,\r\n routes: IRoute[],\r\n categories: ICategory[],\r\n rootCategory: ICategory,\r\n category: ICategory\r\n): IRouteLink | IRouteLink[] | undefined {\r\n const route = findRouteOfCategory(routes, category.id);\r\n const otherCategories = categories.filter(x => x.id !== category.id);\r\n const childCategories = otherCategories.filter(x => asCategoryId(x.category) === category.id);\r\n // console.log('childCategories', category.id, childCategories.map(x => x.id));\r\n const routeLink = newRouteLink(category, route, locale);\r\n // console.log('getRouteLinkCategory', href, category.id, route);\r\n const items: IRouteLink[] = [];\r\n for (const childCategory of childCategories) {\r\n const itemOrItems = getRouteLinkCategory(locale, routes, otherCategories, rootCategory, childCategory);\r\n if (Array.isArray(itemOrItems)) {\r\n items.push(...itemOrItems);\r\n } else if (itemOrItems) {\r\n items.push(itemOrItems);\r\n }\r\n }\r\n if (\r\n !route ||\r\n (category.isHidden && category.id !== rootCategory.id)\r\n ) {\r\n return items;\r\n }\r\n routeLink.items = items;\r\n return routeLink;\r\n}\r\n\r\nexport function newRouteLink(category: ICategory, route: IRoute | undefined, locale: string): IRouteLink {\r\n const href = (route && route.id) ? route.id.toString() : '/';\r\n const id = route?.page || category.id;\r\n const media = category.media || route?.media;\r\n const schema = route?.template || route?.schema || category?.schema || 'unknown';\r\n const title = localize(category.title || route?.title || 'untitled', locale);\r\n const routeLink = {\r\n category: category.id,\r\n href,\r\n id,\r\n items: [],\r\n media,\r\n schema,\r\n title,\r\n };\r\n return routeLink;\r\n}\r\n\r\nexport function resolveRoute(route: IRoute) {\r\n return `/${route.market}/${route.locale}/${route.schema}/${route.page}`;\r\n}\r\n\r\nexport function routeToRouteLink(route: IRoute): IRouteLink {\r\n const routeLink: IRouteLink = {\r\n category: asCategoryId(route.category),\r\n href: route.id,\r\n id: route.page,\r\n items: [],\r\n media: route.media,\r\n schema: route.schema,\r\n title: route.title,\r\n };\r\n return routeLink;\r\n}\r\n\r\n/**\r\n * Converts a route (and optional override title) into an IRouteLink.\r\n * route.id is the pathname (href), route.page is the document ID.\r\n */\r\nexport function routeToLink(route: IRoute, title?: string): IRouteLink {\r\n return {\r\n category: route.category,\r\n href: route.id,\r\n id: route.page,\r\n schema: route.schema,\r\n title: title ?? route.title,\r\n media: route.media,\r\n };\r\n}\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"route.js","names":["locale: string","routes: IRoute[]","categories: ICategory[]","rootCategory: ICategory","category: ICategory","items: IRouteLink[]","route: IRoute | undefined","route: IRoute","routeLink: IRouteLink","title?: string"],"sources":["../../src/lib/route.ts"],"sourcesContent":["import { asCategoryId, findRouteOfCategory, ICategory, IRoute, IRouteLink, localize } from '@websolutespa/bom-core';\r\n\r\nexport function getRouteLinkCategory(\r\n locale: string,\r\n routes: IRoute[],\r\n categories: ICategory[],\r\n rootCategory: ICategory,\r\n category: ICategory\r\n): IRouteLink | IRouteLink[] | undefined {\r\n const route = findRouteOfCategory(routes, category.id);\r\n const otherCategories = categories.filter(x => x.id !== category.id);\r\n const childCategories = otherCategories.filter(x => asCategoryId(x.category) === category.id);\r\n // console.log('childCategories', category.id, childCategories.map(x => x.id));\r\n const routeLink = newRouteLink(category, route, locale);\r\n // console.log('getRouteLinkCategory', href, category.id, route);\r\n const items: IRouteLink[] = [];\r\n for (const childCategory of childCategories) {\r\n const itemOrItems = getRouteLinkCategory(locale, routes, otherCategories, rootCategory, childCategory);\r\n if (Array.isArray(itemOrItems)) {\r\n items.push(...itemOrItems);\r\n } else if (itemOrItems) {\r\n items.push(itemOrItems);\r\n }\r\n }\r\n if (\r\n !route ||\r\n (category.isHidden && category.id !== rootCategory.id)\r\n ) {\r\n return items;\r\n }\r\n routeLink.items = items;\r\n return routeLink;\r\n}\r\n\r\nexport function newRouteLink(category: ICategory, route: IRoute | undefined, locale: string): IRouteLink {\r\n const href = (route && route.id) ? route.id.toString() : '/';\r\n const id = route?.page || category.id;\r\n const media = category.media || route?.media;\r\n const schema = route?.template || route?.schema || category?.schema || 'unknown';\r\n const title = localize(category.title || route?.title || 'untitled', locale);\r\n const routeLink = {\r\n category: category.id,\r\n href,\r\n id,\r\n items: [],\r\n media,\r\n schema,\r\n title,\r\n };\r\n return routeLink;\r\n}\r\n\r\nexport function resolveRoute(route: IRoute) {\r\n return `/${route.market}/${route.locale}/${route.schema}/${route.page}`;\r\n}\r\n\r\nexport function routeToRouteLink(route: IRoute): IRouteLink {\r\n const routeLink: IRouteLink = {\r\n category: asCategoryId(route.category),\r\n href: route.id,\r\n id: route.page,\r\n items: [],\r\n media: route.media,\r\n schema: route.schema,\r\n title: route.title,\r\n };\r\n return routeLink;\r\n}\r\n\r\n/**\r\n * Converts a route (and optional override title) into an IRouteLink.\r\n * route.id is the pathname (href), route.page is the document ID.\r\n */\r\nexport function routeToLink(route: IRoute, title?: string): IRouteLink {\r\n return {\r\n category: route.category,\r\n href: route.id,\r\n id: route.page,\r\n schema: route.schema,\r\n title: title ?? route.title,\r\n media: route.media,\r\n };\r\n}\r\n"],"mappings":";;;AAEA,SAAgB,qBACdA,QACAC,QACAC,YACAC,cACAC,UACuC;CACvC,MAAM,QAAQ,oBAAoB,QAAQ,SAAS,GAAG;CACtD,MAAM,kBAAkB,WAAW,OAAO,OAAK,EAAE,OAAO,SAAS,GAAG;CACpE,MAAM,kBAAkB,gBAAgB,OAAO,OAAK,aAAa,EAAE,SAAS,KAAK,SAAS,GAAG;CAE7F,MAAM,YAAY,aAAa,UAAU,OAAO,OAAO;CAEvD,MAAMC,QAAsB,CAAE;AAC9B,MAAK,MAAM,iBAAiB,iBAAiB;EAC3C,MAAM,cAAc,qBAAqB,QAAQ,QAAQ,iBAAiB,cAAc,cAAc;AACtG,MAAI,MAAM,QAAQ,YAAY,EAC5B,MAAM,KAAK,GAAG,YAAY;WACjB,aACT,MAAM,KAAK,YAAY;CAE1B;AACD,KACE,CAAC,SACA,SAAS,YAAY,SAAS,OAAO,aAAa,GAEnD,QAAO;CAET,UAAU,QAAQ;AAClB,QAA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C,SA8CyC;aA3CrD,aAAA;;;;cAaC,eAAe;aAGhB,aAAA;;;;;;;cAgBC,eAAe;cAWf"}
|
|
1
|
+
{"version":3,"file":"store.d.ts","names":[],"sources":["../../src/lib/store.ts"],"sourcesContent":[],"mappings":";aAAY,SAAA;EAAA,MAAA,GAAA,cAAS;EAgBR,eAAqC,GAAA,wBAAA;EAGtC,gBAAa,GAAA,yBAAA;EAaZ,iBAAiD,GAAA,0BAAA;EAGlD,IAAA,GAAA,YAAa;AAgBzB;AAWa,cA9CA,SA8CoD,EA9CzC,SA8CyC;aA3CrD,aAAA;;;;cAaC,eAAe;aAGhB,aAAA;;;;;;;cAgBC,eAAe;cAWf"}
|
package/dist/lib/store.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
//#region src/lib/store.ts
|
|
2
|
-
let NextPhase = /* @__PURE__ */ function(NextPhase) {
|
|
3
|
-
NextPhase["Export"] = "phase-export";
|
|
4
|
-
NextPhase["ProductionBuild"] = "phase-production-build";
|
|
5
|
-
NextPhase["ProductionServer"] = "phase-production-server";
|
|
6
|
-
NextPhase["DevelopmentServer"] = "phase-development-server";
|
|
7
|
-
NextPhase["Test"] = "phase-test";
|
|
8
|
-
return NextPhase;
|
|
2
|
+
let NextPhase = /* @__PURE__ */ function(NextPhase$1) {
|
|
3
|
+
NextPhase$1["Export"] = "phase-export";
|
|
4
|
+
NextPhase$1["ProductionBuild"] = "phase-production-build";
|
|
5
|
+
NextPhase$1["ProductionServer"] = "phase-production-server";
|
|
6
|
+
NextPhase$1["DevelopmentServer"] = "phase-development-server";
|
|
7
|
+
NextPhase$1["Test"] = "phase-test";
|
|
8
|
+
return NextPhase$1;
|
|
9
9
|
}({});
|
|
10
10
|
function getNextPhase() {
|
|
11
|
-
let nextPhase =
|
|
12
|
-
if (typeof process !== "undefined" && process.env.NEXT_PHASE) nextPhase = process.env.NEXT_PHASE;
|
|
13
|
-
return nextPhase;
|
|
11
|
+
let nextPhase$1 = NextPhase.Export;
|
|
12
|
+
if (typeof process !== "undefined" && process.env.NEXT_PHASE) nextPhase$1 = process.env.NEXT_PHASE;
|
|
13
|
+
return nextPhase$1;
|
|
14
14
|
}
|
|
15
15
|
const nextPhase = getNextPhase();
|
|
16
|
-
let BuildStrategy = /* @__PURE__ */ function(BuildStrategy) {
|
|
17
|
-
BuildStrategy["Static"] = "static";
|
|
18
|
-
BuildStrategy["Runtime"] = "runtime";
|
|
19
|
-
return BuildStrategy;
|
|
16
|
+
let BuildStrategy = /* @__PURE__ */ function(BuildStrategy$1) {
|
|
17
|
+
BuildStrategy$1["Static"] = "static";
|
|
18
|
+
BuildStrategy$1["Runtime"] = "runtime";
|
|
19
|
+
return BuildStrategy$1;
|
|
20
20
|
}({});
|
|
21
21
|
function getBuildStrategy() {
|
|
22
|
-
let buildStrategy =
|
|
23
|
-
if (typeof process !== "undefined" && process.env.BUILD_STRATEGY) buildStrategy = process.env.BUILD_STRATEGY;
|
|
24
|
-
return buildStrategy;
|
|
22
|
+
let buildStrategy$1 = BuildStrategy.Static;
|
|
23
|
+
if (typeof process !== "undefined" && process.env.BUILD_STRATEGY) buildStrategy$1 = process.env.BUILD_STRATEGY;
|
|
24
|
+
return buildStrategy$1;
|
|
25
25
|
}
|
|
26
26
|
const buildStrategy = getBuildStrategy();
|
|
27
|
-
let StoreStrategy = /* @__PURE__ */ function(StoreStrategy) {
|
|
28
|
-
StoreStrategy["Local"] = "local";
|
|
29
|
-
StoreStrategy["Api"] = "api";
|
|
30
|
-
StoreStrategy["DecoratedApi"] = "decoratedApi";
|
|
31
|
-
StoreStrategy["Data"] = "data";
|
|
32
|
-
StoreStrategy["Mock"] = "mock";
|
|
33
|
-
return StoreStrategy;
|
|
27
|
+
let StoreStrategy = /* @__PURE__ */ function(StoreStrategy$1) {
|
|
28
|
+
StoreStrategy$1["Local"] = "local";
|
|
29
|
+
StoreStrategy$1["Api"] = "api";
|
|
30
|
+
StoreStrategy$1["DecoratedApi"] = "decoratedApi";
|
|
31
|
+
StoreStrategy$1["Data"] = "data";
|
|
32
|
+
StoreStrategy$1["Mock"] = "mock";
|
|
33
|
+
return StoreStrategy$1;
|
|
34
34
|
}({});
|
|
35
35
|
function getStoreStrategy() {
|
|
36
|
-
let storeStrategy =
|
|
37
|
-
if (typeof process !== "undefined" && process.env.STORE_STRATEGY) storeStrategy = process.env.STORE_STRATEGY;
|
|
38
|
-
return storeStrategy;
|
|
36
|
+
let storeStrategy$1 = StoreStrategy.Mock;
|
|
37
|
+
if (typeof process !== "undefined" && process.env.STORE_STRATEGY) storeStrategy$1 = process.env.STORE_STRATEGY;
|
|
38
|
+
return storeStrategy$1;
|
|
39
39
|
}
|
|
40
40
|
const storeStrategy = getStoreStrategy();
|
|
41
41
|
function getStoreCacheDuration() {
|
|
42
|
-
let storeCacheDuration =
|
|
43
|
-
if (typeof process !== "undefined" && process.env.STORE_CACHE_DURATION) storeCacheDuration = parseInt(process.env.STORE_CACHE_DURATION);
|
|
44
|
-
return storeCacheDuration;
|
|
42
|
+
let storeCacheDuration$1 = 60 * 1e3;
|
|
43
|
+
if (typeof process !== "undefined" && process.env.STORE_CACHE_DURATION) storeCacheDuration$1 = parseInt(process.env.STORE_CACHE_DURATION);
|
|
44
|
+
return storeCacheDuration$1;
|
|
45
45
|
}
|
|
46
46
|
const storeCacheDuration = getStoreCacheDuration();
|
|
47
|
+
|
|
47
48
|
//#endregion
|
|
48
49
|
export { BuildStrategy, NextPhase, StoreStrategy, buildStrategy, nextPhase, storeCacheDuration, storeStrategy };
|
|
49
|
-
|
|
50
50
|
//# sourceMappingURL=store.js.map
|
package/dist/lib/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","names":[],"sources":["../../src/lib/store.ts"],"sourcesContent":["export enum NextPhase {\r\n Export = 'phase-export',\r\n ProductionBuild = 'phase-production-build',\r\n ProductionServer = 'phase-production-server',\r\n DevelopmentServer = 'phase-development-server',\r\n Test = 'phase-test',\r\n}\r\n\r\nfunction getNextPhase(): NextPhase {\r\n let nextPhase = NextPhase.Export;\r\n if (typeof process !== 'undefined' && process.env.NEXT_PHASE) {\r\n nextPhase = process.env.NEXT_PHASE as NextPhase;\r\n }\r\n return nextPhase;\r\n}\r\n\r\nexport const nextPhase: NextPhase = getNextPhase();\r\n\r\n// buildStrategy\r\nexport enum BuildStrategy {\r\n Static = 'static',\r\n Runtime = 'runtime',\r\n}\r\n\r\nfunction getBuildStrategy(): BuildStrategy {\r\n let buildStrategy = BuildStrategy.Static;\r\n if (typeof process !== 'undefined' && process.env.BUILD_STRATEGY) {\r\n buildStrategy = process.env.BUILD_STRATEGY as BuildStrategy;\r\n }\r\n return buildStrategy;\r\n}\r\n\r\nexport const buildStrategy: BuildStrategy = getBuildStrategy();\r\n\r\n// storeStrategy\r\nexport enum StoreStrategy {\r\n Local = 'local',\r\n Api = 'api',\r\n DecoratedApi = 'decoratedApi',\r\n Data = 'data',\r\n Mock = 'mock',\r\n}\r\n\r\nfunction getStoreStrategy(): StoreStrategy {\r\n let storeStrategy = StoreStrategy.Mock;\r\n if (typeof process !== 'undefined' && process.env.STORE_STRATEGY) {\r\n storeStrategy = process.env.STORE_STRATEGY as StoreStrategy;\r\n }\r\n return storeStrategy;\r\n}\r\n\r\nexport const storeStrategy: StoreStrategy = getStoreStrategy();\r\n\r\n// storeCacheDuration\r\nfunction getStoreCacheDuration(): number {\r\n let storeCacheDuration = (1 * 60 * 1000);\r\n if (typeof process !== 'undefined' && process.env.STORE_CACHE_DURATION) {\r\n storeCacheDuration = parseInt(process.env.STORE_CACHE_DURATION);\r\n }\r\n return storeCacheDuration;\r\n}\r\n\r\nexport const storeCacheDuration: number = getStoreCacheDuration();\r\n"],"mappings":";AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"store.js","names":["nextPhase","nextPhase: NextPhase","buildStrategy","buildStrategy: BuildStrategy","storeStrategy","storeStrategy: StoreStrategy","storeCacheDuration","storeCacheDuration: number"],"sources":["../../src/lib/store.ts"],"sourcesContent":["export enum NextPhase {\r\n Export = 'phase-export',\r\n ProductionBuild = 'phase-production-build',\r\n ProductionServer = 'phase-production-server',\r\n DevelopmentServer = 'phase-development-server',\r\n Test = 'phase-test',\r\n}\r\n\r\nfunction getNextPhase(): NextPhase {\r\n let nextPhase = NextPhase.Export;\r\n if (typeof process !== 'undefined' && process.env.NEXT_PHASE) {\r\n nextPhase = process.env.NEXT_PHASE as NextPhase;\r\n }\r\n return nextPhase;\r\n}\r\n\r\nexport const nextPhase: NextPhase = getNextPhase();\r\n\r\n// buildStrategy\r\nexport enum BuildStrategy {\r\n Static = 'static',\r\n Runtime = 'runtime',\r\n}\r\n\r\nfunction getBuildStrategy(): BuildStrategy {\r\n let buildStrategy = BuildStrategy.Static;\r\n if (typeof process !== 'undefined' && process.env.BUILD_STRATEGY) {\r\n buildStrategy = process.env.BUILD_STRATEGY as BuildStrategy;\r\n }\r\n return buildStrategy;\r\n}\r\n\r\nexport const buildStrategy: BuildStrategy = getBuildStrategy();\r\n\r\n// storeStrategy\r\nexport enum StoreStrategy {\r\n Local = 'local',\r\n Api = 'api',\r\n DecoratedApi = 'decoratedApi',\r\n Data = 'data',\r\n Mock = 'mock',\r\n}\r\n\r\nfunction getStoreStrategy(): StoreStrategy {\r\n let storeStrategy = StoreStrategy.Mock;\r\n if (typeof process !== 'undefined' && process.env.STORE_STRATEGY) {\r\n storeStrategy = process.env.STORE_STRATEGY as StoreStrategy;\r\n }\r\n return storeStrategy;\r\n}\r\n\r\nexport const storeStrategy: StoreStrategy = getStoreStrategy();\r\n\r\n// storeCacheDuration\r\nfunction getStoreCacheDuration(): number {\r\n let storeCacheDuration = (1 * 60 * 1000);\r\n if (typeof process !== 'undefined' && process.env.STORE_CACHE_DURATION) {\r\n storeCacheDuration = parseInt(process.env.STORE_CACHE_DURATION);\r\n }\r\n return storeCacheDuration;\r\n}\r\n\r\nexport const storeCacheDuration: number = getStoreCacheDuration();\r\n"],"mappings":";AAAA,IAAY,kDAAL;;;;;;;A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
{"version":3,"file":"structured-data.d.ts","names":[],"sources":["../../src/lib/structured-data.ts"],"sourcesContent":[],"mappings":";;;KAEY,kBAAA,GACR,cAAA,CAAe,UACf,cAAA,CAAe,cACf,cAAA,CAAe,cACf,cAAA,CAAe,iBACf,cAAA,CAAe,SACf,cAAA,CAAe,QACf,cAAA,CAAe,UACf,cAAA,CAAe,QACf,cAAA,CAAe,WACf,cAAA,CAAe,aACf,cAAA,CAAe,WACf,cAAA,CAAe,gBACf,cAAA,CAAe,cACf,cAAA,CAAe,eACf,cAAA,CAAe,SACf,cAAA,CAAe,QACf,cAAA,CAAe,UACf,cAAA,CAAe,SACf,cAAA,CAAe,cACf,cAAA,CAAe,UACf,cAAA,CAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitter-card.d.ts","names":[],"sources":["../../src/lib/twitter-card.ts"],"mappings":";UAEiB,eAAA;EAAA,IAAA,EAAA,SAAA,GAAe,qBAAA,GAAA,KAAA,GAAA,QAAA;EAYf,IAAA,CAAA,EAAA,MAAA;EAIA,MAAA,CAAA,EAAA,MAAA;EAIA,OAAA,CAAA,EAAA,MAAA;EAcA,SAAA,CAAA,EAAA,MAAA;EAQL,KAAA,CAAA,EAAA,MAAA;EAAe,WAAA,CAAA,EAAA,MAAA;
|
|
1
|
+
{"version":3,"file":"twitter-card.d.ts","names":[],"sources":["../../src/lib/twitter-card.ts"],"sourcesContent":[],"mappings":";UAEiB,eAAA;EAAA,IAAA,EAAA,SAAA,GAAe,qBAAA,GAAA,KAAA,GAAA,QAAA;EAYf,IAAA,CAAA,EAAA,MAAA;EAIA,MAAA,CAAA,EAAA,MAAA;EAIA,OAAA,CAAA,EAAA,MAAA;EAcA,SAAA,CAAA,EAAA,MAAA;EAQL,KAAA,CAAA,EAAA,MAAA;EAAe,WAAA,CAAA,EAAA,MAAA;EAAA,KACvB,CAAA,EAAA,MAAA;EAAc,QACd,CAAA,EAAA,MAAA;;AAEA,UAlCa,kBAAA,SAA2B,eAkCxC,CAAA;EAA4B,IAAA,EAAA,SAAA;;UA9Bf,4BAAA,SAAqC;;;UAIrC,cAAA,SAAuB;;;;;;;;;;;;;UAcvB,iBAAA,SAA0B;;;;;;;KAQ/B,eAAA,GACR,iBACA,oBACA,qBACA"}
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/lib/utils.ts"],"mappings":";iBACgB,YAAA,CAAA;AAAA,iBAKA,WAAA,CALY,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAKZ,iBAIA,iBAAA,CAJW,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAIX,iBAIA,YAAA,CAJiB,GAAA,EAIC,GAJD,EAAA,iBAAA,EAIyB,GAJzB,GAAA,IAAA,CAAA,EAAA,MAAA;AAIjB,iBAUA,oBAAA,CAVY,IAAA,EAAA,MAAA,EAAA,GAAA,EAU4B,GAV5B,EAAA,iBAAA,EAUoD,GAVpD,GAAA,IAAA,CAAA,EAAA,MAAA;AAAA,iBAmBZ,kBAAA,CAnBY,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;AAAM,iBAuBlB,mBAAA,CAvBkB,IAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAuBiC,GAvBjC,CAAA,EAAA,MAAA,GAAA,SAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":[],"mappings":";iBACgB,YAAA,CAAA;AAAA,iBAKA,WAAA,CALY,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAKZ,iBAIA,iBAAA,CAJW,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAIX,iBAIA,YAAA,CAJiB,GAAA,EAIC,GAJD,EAAA,iBAAA,EAIyB,GAJzB,GAAA,IAAA,CAAA,EAAA,MAAA;AAIjB,iBAUA,oBAAA,CAVY,IAAA,EAAA,MAAA,EAAA,GAAA,EAU4B,GAV5B,EAAA,iBAAA,EAUoD,GAVpD,GAAA,IAAA,CAAA,EAAA,MAAA;AAAA,iBAmBZ,kBAAA,CAnBY,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;AAAM,iBAuBlB,mBAAA,CAvBkB,IAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAuBiC,GAvBjC,CAAA,EAAA,MAAA,GAAA,SAAA"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/lib/utils.ts
|
|
2
2
|
function getPublicUrl() {
|
|
3
|
-
|
|
3
|
+
const publicUrl = process.env && process.env.NEXT_PUBLIC_URL ? process.env.NEXT_PUBLIC_URL : "";
|
|
4
|
+
return publicUrl;
|
|
4
5
|
}
|
|
5
6
|
function resolveHref(href = "") {
|
|
6
7
|
return href.startsWith("http") ? href : `${getPublicUrl()}${href}`;
|
|
@@ -29,7 +30,7 @@ function sanitizeRedirectUrl(path, url) {
|
|
|
29
30
|
return path.match(/^((https?:\/\/)+)/) ? path : `${url.origin}${path}`;
|
|
30
31
|
} else return path;
|
|
31
32
|
}
|
|
33
|
+
|
|
32
34
|
//#endregion
|
|
33
35
|
export { getPublicUrl, resolveHref, sanitizeHref, sanitizeRedirectFrom, sanitizeRedirectTo, sanitizeRedirectUrl, trimTerminalSlash };
|
|
34
|
-
|
|
35
36
|
//# sourceMappingURL=utils.js.map
|
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["\r\nexport function getPublicUrl() {\r\n const publicUrl = process.env && process.env.NEXT_PUBLIC_URL ? process.env.NEXT_PUBLIC_URL : '';\r\n return publicUrl;\r\n}\r\n\r\nexport function resolveHref(href: string = '') {\r\n return href.startsWith('http') ? href : `${getPublicUrl()}${href}`;\r\n}\r\n\r\nexport function trimTerminalSlash(path: string) {\r\n return path.replace(/\\/+$/, '');\r\n}\r\n\r\nexport function sanitizeHref(url: URL, urlBeforeRedirect: URL | null) {\r\n if (urlBeforeRedirect) {\r\n const sanitizedUrl = new URL(urlBeforeRedirect);\r\n sanitizedUrl.protocol = url.protocol;\r\n return trimTerminalSlash(sanitizedUrl.href);\r\n } else {\r\n return trimTerminalSlash(url.href);\r\n }\r\n}\r\n\r\nexport function sanitizeRedirectFrom(path: string, url: URL, urlBeforeRedirect: URL | null) {\r\n path = trimTerminalSlash(path);\r\n if (urlBeforeRedirect) {\r\n return path.replace(/^(\\^?)((https?:\\/\\/)+)/, `$1${url.protocol}//`);\r\n } else {\r\n return path.replace(/^(\\^?)((https?:\\/\\/)+(\\w|\\.|:)+)/, `$1${url.origin}`);\r\n }\r\n}\r\n\r\nexport function sanitizeRedirectTo(path?: string) {\r\n return path ? trimTerminalSlash(path) : undefined;\r\n}\r\n\r\nexport function sanitizeRedirectUrl(path: string | undefined, url: URL) {\r\n if (path != null) {\r\n path = trimTerminalSlash(path);\r\n return path.match(/^((https?:\\/\\/)+)/) ? path : `${url.origin}${path}`;\r\n } else {\r\n return path;\r\n }\r\n}\r\n"],"mappings":";AACA,SAAgB,eAAe;
|
|
1
|
+
{"version":3,"file":"utils.js","names":["href: string","path: string","url: URL","urlBeforeRedirect: URL | null","path?: string","path: string | undefined"],"sources":["../../src/lib/utils.ts"],"sourcesContent":["\r\nexport function getPublicUrl() {\r\n const publicUrl = process.env && process.env.NEXT_PUBLIC_URL ? process.env.NEXT_PUBLIC_URL : '';\r\n return publicUrl;\r\n}\r\n\r\nexport function resolveHref(href: string = '') {\r\n return href.startsWith('http') ? href : `${getPublicUrl()}${href}`;\r\n}\r\n\r\nexport function trimTerminalSlash(path: string) {\r\n return path.replace(/\\/+$/, '');\r\n}\r\n\r\nexport function sanitizeHref(url: URL, urlBeforeRedirect: URL | null) {\r\n if (urlBeforeRedirect) {\r\n const sanitizedUrl = new URL(urlBeforeRedirect);\r\n sanitizedUrl.protocol = url.protocol;\r\n return trimTerminalSlash(sanitizedUrl.href);\r\n } else {\r\n return trimTerminalSlash(url.href);\r\n }\r\n}\r\n\r\nexport function sanitizeRedirectFrom(path: string, url: URL, urlBeforeRedirect: URL | null) {\r\n path = trimTerminalSlash(path);\r\n if (urlBeforeRedirect) {\r\n return path.replace(/^(\\^?)((https?:\\/\\/)+)/, `$1${url.protocol}//`);\r\n } else {\r\n return path.replace(/^(\\^?)((https?:\\/\\/)+(\\w|\\.|:)+)/, `$1${url.origin}`);\r\n }\r\n}\r\n\r\nexport function sanitizeRedirectTo(path?: string) {\r\n return path ? trimTerminalSlash(path) : undefined;\r\n}\r\n\r\nexport function sanitizeRedirectUrl(path: string | undefined, url: URL) {\r\n if (path != null) {\r\n path = trimTerminalSlash(path);\r\n return path.match(/^((https?:\\/\\/)+)/) ? path : `${url.origin}${path}`;\r\n } else {\r\n return path;\r\n }\r\n}\r\n"],"mappings":";AACA,SAAgB,eAAe;CAC7B,MAAM,YAAY,QAAQ,OAAO,QAAQ,IAAI,kBAAkB,QAAQ,IAAI,kBAAkB;AAC7F,QAAO;AACR;AAED,SAAgB,YAAYA,OAAe,IAAI;AAC7C,QAAO,KAAK,WAAW,OAAO,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM;AACnE;AAED,SAAgB,kBAAkBC,MAAc;AAC9C,QAAO,KAAK,QAAQ,QAAQ,GAAG;AAChC;AAED,SAAgB,aAAaC,KAAUC,mBAA+B;AACpE,KAAI,mBAAmB;EACrB,MAAM,eAAe,IAAI,IAAI;EAC7B,aAAa,WAAW,IAAI;AAC5B,SAAO,kBAAkB,aAAa,KAAK;CAC5C,MACC,QAAO,kBAAkB,IAAI,KAAK;AAErC;AAED,SAAgB,qBAAqBF,MAAcC,KAAUC,mBAA+B;CAC1F,OAAO,kBAAkB,KAAK;AAC9B,KAAI,kBACF,QAAO,KAAK,QAAQ,0BAA0B,CAAC,EAAE,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;KAEpE,QAAO,KAAK,QAAQ,oCAAoC,CAAC,EAAE,EAAE,IAAI,QAAQ,CAAC;AAE7E;AAED,SAAgB,mBAAmBC,MAAe;AAChD,QAAO,OAAO,kBAAkB,KAAK,GAAG;AACzC;AAED,SAAgB,oBAAoBC,MAA0BH,KAAU;AACtE,KAAI,QAAQ,MAAM;EAChB,OAAO,kBAAkB,KAAK;AAC9B,SAAO,KAAK,MAAM,oBAAoB,GAAG,OAAO,GAAG,IAAI,SAAS,MAAM;CACvE,MACC,QAAO;AAEV"}
|
package/dist/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","names":[],"sources":["../src/mock.ts"],"mappings":";;;KAEK,8BAA8B,IAAI,EAAE,MAFE,GAEtC,CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"mock.d.ts","names":[],"sources":["../src/mock.ts"],"sourcesContent":[],"mappings":";;;KAEK,8BAA8B,IAAI,EAAE,MAFE,GAEtC,CAAA,CAAA;KAEA,YAFQ,CAAA,CAAA,CAAA,GAAA,UAAsB,MAGnB,CAHmB,KAGb,IAHa,CAGR,CAHQ,EAGL,GAHK,CAAA,SAGQ,QAHR,CAGiB,IAHjB,CAGsB,CAHtB,EAGyB,GAHzB,CAAA,CAAA,GAGiC,GAHjC,GAAA,KAAA,EAAC,CAAA,MAI5B,CAJ+B,CAAA;KAMlC,aAAA,GANoC;EAAG,WAAA,EAAA,MAAA;EAEvC,OAAA,CAAA,EAAA,MAAY;CAAA;KASZ,UAAA,GAAa,OARF,CAQU,WARV,EAAA,MAAA,CAAA;KAUX,WAAA,GAVsB,aAAA,GAAA,WAAA,GAAA,MAAA,GAAA,WAAA,GAAA,eAAA,GAAA,yBAAA,GAAA,oBAAA,GAAA,MAAA,GAAA,UAAA,GAAA,WAAA,GAAA,SAAA;KAuBtB,cAAA,GAvByB,UAAA,GAAA,KAAA,GAAA,aAAA,GAAA,OAAA,G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.js";
|
|
2
2
|
import { Picker } from "../../../selderee/lib/selderee.js";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
//#region ../../../node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs
|
|
4
5
|
function hp2Builder(nodes) {
|
|
5
6
|
return new Picker(handleArray(nodes));
|
|
6
7
|
}
|
|
@@ -69,7 +70,7 @@ function handlePopElementNode(node) {
|
|
|
69
70
|
const continuation = handleArray(node.cont);
|
|
70
71
|
return (el, next, ...tail) => continuation(next, ...tail);
|
|
71
72
|
}
|
|
73
|
+
|
|
72
74
|
//#endregion
|
|
73
75
|
export { hp2Builder };
|
|
74
|
-
|
|
75
76
|
//# sourceMappingURL=hp2-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hp2-builder.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"hp2-builder.js","names":[],"sources":["../../../../../../../../node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs"],"sourcesContent":["import { isTag } from 'domhandler';\nimport { Picker } from 'selderee';\n\nfunction hp2Builder(nodes) {\n return new Picker(handleArray(nodes));\n}\nfunction handleArray(nodes) {\n const matchers = nodes.map(handleNode);\n return (el, ...tail) => matchers.flatMap(m => m(el, ...tail));\n}\nfunction handleNode(node) {\n switch (node.type) {\n case 'terminal': {\n const result = [node.valueContainer];\n return (el, ...tail) => result;\n }\n case 'tagName':\n return handleTagName(node);\n case 'attrValue':\n return handleAttrValueName(node);\n case 'attrPresence':\n return handleAttrPresenceName(node);\n case 'pushElement':\n return handlePushElementNode(node);\n case 'popElement':\n return handlePopElementNode(node);\n }\n}\nfunction handleTagName(node) {\n const variants = {};\n for (const variant of node.variants) {\n variants[variant.value] = handleArray(variant.cont);\n }\n return (el, ...tail) => {\n const continuation = variants[el.name];\n return (continuation) ? continuation(el, ...tail) : [];\n };\n}\nfunction handleAttrPresenceName(node) {\n const attrName = node.name;\n const continuation = handleArray(node.cont);\n return (el, ...tail) => (Object.prototype.hasOwnProperty.call(el.attribs, attrName))\n ? continuation(el, ...tail)\n : [];\n}\nfunction handleAttrValueName(node) {\n const callbacks = [];\n for (const matcher of node.matchers) {\n const predicate = matcher.predicate;\n const continuation = handleArray(matcher.cont);\n callbacks.push((attr, el, ...tail) => (predicate(attr) ? continuation(el, ...tail) : []));\n }\n const attrName = node.name;\n return (el, ...tail) => {\n const attr = el.attribs[attrName];\n return (attr || attr === '')\n ? callbacks.flatMap(cb => cb(attr, el, ...tail))\n : [];\n };\n}\nfunction handlePushElementNode(node) {\n const continuation = handleArray(node.cont);\n const leftElementGetter = (node.combinator === '+')\n ? getPrecedingElement\n : getParentElement;\n return (el, ...tail) => {\n const next = leftElementGetter(el);\n if (next === null) {\n return [];\n }\n return continuation(next, el, ...tail);\n };\n}\nconst getPrecedingElement = (el) => {\n const prev = el.prev;\n if (prev === null) {\n return null;\n }\n return (isTag(prev)) ? prev : getPrecedingElement(prev);\n};\nconst getParentElement = (el) => {\n const parent = el.parent;\n return (parent && isTag(parent)) ? parent : null;\n};\nfunction handlePopElementNode(node) {\n const continuation = handleArray(node.cont);\n return (el, next, ...tail) => continuation(next, ...tail);\n}\n\nexport { hp2Builder };\n"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,SAAS,WAAW,OAAO;AACvB,QAAO,IAAI,OAAO,YAAY,MAAM;AACvC;AACD,SAAS,YAAY,OAAO;CACxB,MAAM,WAAW,MAAM,IAAI,WAAW;AACtC,QAAO,CAAC,IAAI,GAAG,SAAS,SAAS,QAAQ,OAAK,EAAE,IAAI,GAAG,KAAK,CAAC;AAChE;AACD,SAAS,WAAW,MAAM;AACtB,SAAQ,KAAK,MAAb;EACI,KAAK,YAAY;GACb,MAAM,SAAS,CAAC,KAAK,cAAe;AACpC,UAAO,CAAC,IAAI,GAAG,SAAS;EAC3B;EACD,KAAK,UACD,QAAO,cAAc,KAAK;EAC9B,KAAK,YACD,QAAO,oBAAoB,KAAK;EACpC,KAAK,eACD,QAAO,uBAAuB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AAO,CAAE;AAEb,SAAO,aAAa,MAAM,IAAI,GAAG,KAAK;CACzC;AACJ;AACD,MAAM,sBAAsB,CAAC,OAAO;CAChC,MAAM,OAAO,GAAG;AAChB,KAAI,SAAS,KACT,QAAO;AAEX,QAAQ,MAAM,KAAK,GAAI,OAAO,oBAAoB,KAAK;AAC1D;AACD,MAAM,mBAAmB,CAAC,OAAO;CAC7B,MAAM,SAAS,GAAG;AAClB,QAAQ,UAAU,MAAM,OAAO,GAAI,SAAS;AAC/C;AACD,SAAS,qBAAqB,MAAM;CAChC,MAAM,eAAe,YAAY,KAAK,KAAK;AAC3C,QAAO,CAAC,IAAI,MAAM,GAAG,SAAS,aAAa,MAAM,GAAG,KAAK;AAC5D"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { __commonJS } from "../../../_virtual/rolldown_runtime.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../../node_modules/deepmerge/dist/cjs.js
|
|
6
|
+
var require_cjs = /* @__PURE__ */ __commonJS({ "../../../node_modules/deepmerge/dist/cjs.js": ((exports, module) => {
|
|
7
|
+
var isMergeableObject = function isMergeableObject$1(value) {
|
|
5
8
|
return isNonNullObject(value) && !isSpecial(value);
|
|
6
9
|
};
|
|
7
10
|
function isNonNullObject(value) {
|
|
@@ -11,7 +14,8 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11
14
|
var stringValue = Object.prototype.toString.call(value);
|
|
12
15
|
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
13
16
|
}
|
|
14
|
-
var
|
|
17
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
18
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
15
19
|
function isReactElement(value) {
|
|
16
20
|
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
17
21
|
}
|
|
@@ -67,7 +71,9 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
67
71
|
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
68
72
|
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
69
73
|
var sourceIsArray = Array.isArray(source);
|
|
70
|
-
|
|
74
|
+
var targetIsArray = Array.isArray(target);
|
|
75
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
76
|
+
if (!sourceAndTargetTypesMatch) return cloneUnlessOtherwiseSpecified(source, options);
|
|
71
77
|
else if (sourceIsArray) return options.arrayMerge(target, source, options);
|
|
72
78
|
else return mergeObject(target, source, options);
|
|
73
79
|
}
|
|
@@ -77,10 +83,12 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
77
83
|
return deepmerge(prev, next, options);
|
|
78
84
|
}, {});
|
|
79
85
|
};
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
var deepmerge_1 = deepmerge;
|
|
87
|
+
module.exports = deepmerge_1;
|
|
88
|
+
}) });
|
|
89
|
+
|
|
82
90
|
//#endregion
|
|
83
91
|
export default require_cjs();
|
|
84
|
-
export { require_cjs };
|
|
85
92
|
|
|
93
|
+
export { require_cjs };
|
|
86
94
|
//# sourceMappingURL=cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cjs.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"cjs.js","names":["isMergeableObject"],"sources":["../../../../../../../node_modules/deepmerge/dist/cjs.js"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CAEA,IAAI,oBAAoB,SAASA,oBAAkB,OAAO;AACzD,SAAO,gBAAgB,MAAM,IACzB,CAAC,UAAU,MAAM;CACrB;CAED,SAAS,gBAAgB,OAAO;AAC/B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M,MAAM,QAAQ;EACrC,GAAE,CAAE,EAAC;CACN;CAED,IAAI,cAAc;CAElB,OAAO,UAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../../../node_modules/dom-serializer/lib/esm/foreignNames.js
|
|
2
2
|
const elementNames = new Map([
|
|
3
3
|
"altGlyph",
|
|
4
4
|
"altGlyphDef",
|
|
@@ -99,7 +99,7 @@ const attributeNames = new Map([
|
|
|
99
99
|
"yChannelSelector",
|
|
100
100
|
"zoomAndPan"
|
|
101
101
|
].map((val) => [val.toLowerCase(), val]));
|
|
102
|
+
|
|
102
103
|
//#endregion
|
|
103
104
|
export { attributeNames, elementNames };
|
|
104
|
-
|
|
105
105
|
//# sourceMappingURL=foreignNames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreignNames.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"foreignNames.js","names":[],"sources":["../../../../../../../../node_modules/dom-serializer/lib/esm/foreignNames.js"],"sourcesContent":["export const elementNames = new Map([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"clipPath\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feDropShadow\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"foreignObject\",\n \"glyphRef\",\n \"linearGradient\",\n \"radialGradient\",\n \"textPath\",\n].map((val) => [val.toLowerCase(), val]));\nexport const attributeNames = new Map([\n \"definitionURL\",\n \"attributeName\",\n \"attributeType\",\n \"baseFrequency\",\n \"baseProfile\",\n \"calcMode\",\n \"clipPathUnits\",\n \"diffuseConstant\",\n \"edgeMode\",\n \"filterUnits\",\n \"glyphRef\",\n \"gradientTransform\",\n \"gradientUnits\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keyPoints\",\n \"keySplines\",\n \"keyTimes\",\n \"lengthAdjust\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerUnits\",\n \"markerWidth\",\n \"maskContentUnits\",\n \"maskUnits\",\n \"numOctaves\",\n \"pathLength\",\n \"patternContentUnits\",\n \"patternTransform\",\n \"patternUnits\",\n \"pointsAtX\",\n \"pointsAtY\",\n \"pointsAtZ\",\n \"preserveAlpha\",\n \"preserveAspectRatio\",\n \"primitiveUnits\",\n \"refX\",\n \"refY\",\n \"repeatCount\",\n \"repeatDur\",\n \"requiredExtensions\",\n \"requiredFeatures\",\n \"specularConstant\",\n \"specularExponent\",\n \"spreadMethod\",\n \"startOffset\",\n \"stdDeviation\",\n \"stitchTiles\",\n \"surfaceScale\",\n \"systemLanguage\",\n \"tableValues\",\n \"targetX\",\n \"targetY\",\n \"textLength\",\n \"viewBox\",\n \"viewTarget\",\n \"xChannelSelector\",\n \"yChannelSelector\",\n \"zoomAndPan\",\n].map((val) => [val.toLowerCase(), val]));\n"],"x_google_ignoreList":[0],"mappings":";AAAA,MAAa,eAAe,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACH,EAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,GAAI,EAAC;AACxC,MAAa,iBAAiB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACH,EAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,GAAI,EAAC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { CDATA, Comment, Directive, Doctype, Root, Script, Style, Tag, Text } from "../../../domelementtype/lib/esm/index.js";
|
|
2
2
|
import { encodeXML, escapeAttribute, escapeText } from "../../../entities/lib/esm/escape.js";
|
|
3
3
|
import { attributeNames, elementNames } from "./foreignNames.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* recognized by the HTML parser.
|
|
8
|
-
*
|
|
9
|
-
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
10
|
-
*/
|
|
11
|
-
const unencodedElements = /* @__PURE__ */ new Set([
|
|
4
|
+
|
|
5
|
+
//#region ../../../node_modules/dom-serializer/lib/esm/index.js
|
|
6
|
+
const unencodedElements = new Set([
|
|
12
7
|
"style",
|
|
13
8
|
"script",
|
|
14
9
|
"xmp",
|
|
@@ -29,8 +24,8 @@ function formatAttributes(attributes, opts) {
|
|
|
29
24
|
if (!attributes) return;
|
|
30
25
|
const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute;
|
|
31
26
|
return Object.keys(attributes).map((key) => {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
|
27
|
+
var _a$1, _b;
|
|
28
|
+
const value = (_a$1 = attributes[key]) !== null && _a$1 !== void 0 ? _a$1 : "";
|
|
34
29
|
if (opts.xmlMode === "foreign") key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
|
35
30
|
if (!opts.emptyAttrs && !opts.xmlMode && value === "") return key;
|
|
36
31
|
return `${key}="${encode(value)}"`;
|
|
@@ -39,7 +34,7 @@ function formatAttributes(attributes, opts) {
|
|
|
39
34
|
/**
|
|
40
35
|
* Self-enclosing tags
|
|
41
36
|
*/
|
|
42
|
-
const singleTag =
|
|
37
|
+
const singleTag = new Set([
|
|
43
38
|
"area",
|
|
44
39
|
"base",
|
|
45
40
|
"basefont",
|
|
@@ -87,7 +82,7 @@ function renderNode(node, options) {
|
|
|
87
82
|
case Text: return renderText(node, options);
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
|
-
const foreignModeIntegrationPoints =
|
|
85
|
+
const foreignModeIntegrationPoints = new Set([
|
|
91
86
|
"mi",
|
|
92
87
|
"mo",
|
|
93
88
|
"mn",
|
|
@@ -98,7 +93,7 @@ const foreignModeIntegrationPoints = /* @__PURE__ */ new Set([
|
|
|
98
93
|
"desc",
|
|
99
94
|
"title"
|
|
100
95
|
]);
|
|
101
|
-
const foreignElements =
|
|
96
|
+
const foreignElements = new Set(["svg", "math"]);
|
|
102
97
|
function renderTag(elem, opts) {
|
|
103
98
|
var _a;
|
|
104
99
|
if (opts.xmlMode === "foreign") {
|
|
@@ -140,7 +135,7 @@ function renderCdata(elem) {
|
|
|
140
135
|
function renderComment(elem) {
|
|
141
136
|
return `<!--${elem.data}-->`;
|
|
142
137
|
}
|
|
143
|
-
//#endregion
|
|
144
|
-
export { render as default, render };
|
|
145
138
|
|
|
139
|
+
//#endregion
|
|
140
|
+
export { render };
|
|
146
141
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_a"],"sources":["../../../../../../../../node_modules/dom-serializer/lib/esm/index.js"],"sourcesContent":["/*\n * Module dependencies\n */\nimport * as ElementType from \"domelementtype\";\nimport { encodeXML, escapeAttribute, escapeText } from \"entities\";\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nimport { elementNames, attributeNames } from \"./foreignNames.js\";\nconst unencodedElements = new Set([\n \"style\",\n \"script\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"noscript\",\n]);\nfunction replaceQuotes(value) {\n return value.replace(/\"/g, \""\");\n}\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n var _a;\n if (!attributes)\n return;\n const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false\n ? replaceQuotes\n : opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? encodeXML\n : escapeAttribute;\n return Object.keys(attributes)\n .map((key) => {\n var _a, _b;\n const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : \"\";\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case attribute names */\n key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === \"\") {\n return key;\n }\n return `${key}=\"${encode(value)}\"`;\n })\n .join(\" \");\n}\n/**\n * Self-enclosing tags\n */\nconst singleTag = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nexport function render(node, options = {}) {\n const nodes = \"length\" in node ? node : [node];\n let output = \"\";\n for (let i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexport default render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n // @ts-expect-error We don't use `Doctype` yet\n case ElementType.Doctype:\n case ElementType.Directive:\n return renderDirective(node);\n case ElementType.Comment:\n return renderComment(node);\n case ElementType.CDATA:\n return renderCdata(node);\n case ElementType.Script:\n case ElementType.Style:\n case ElementType.Tag:\n return renderTag(node, options);\n case ElementType.Text:\n return renderText(node, options);\n }\n}\nconst foreignModeIntegrationPoints = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignObject\",\n \"desc\",\n \"title\",\n]);\nconst foreignElements = new Set([\"svg\", \"math\"]);\nfunction renderTag(elem, opts) {\n var _a;\n // Handle SVG / MathML in HTML\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case element names */\n elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;\n /* Exit foreign mode at integration points */\n if (elem.parent &&\n foreignModeIntegrationPoints.has(elem.parent.name)) {\n opts = { ...opts, xmlMode: false };\n }\n }\n if (!opts.xmlMode && foreignElements.has(elem.name)) {\n opts = { ...opts, xmlMode: \"foreign\" };\n }\n let tag = `<${elem.name}`;\n const attribs = formatAttributes(elem.attribs, opts);\n if (attribs) {\n tag += ` ${attribs}`;\n }\n if (elem.children.length === 0 &&\n (opts.xmlMode\n ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags\n opts.selfClosingTags !== false\n : // User explicitly asked for self-closing tags, even in HTML mode\n opts.selfClosingTags && singleTag.has(elem.name))) {\n if (!opts.xmlMode)\n tag += \" \";\n tag += \"/>\";\n }\n else {\n tag += \">\";\n if (elem.children.length > 0) {\n tag += render(elem.children, opts);\n }\n if (opts.xmlMode || !singleTag.has(elem.name)) {\n tag += `</${elem.name}>`;\n }\n }\n return tag;\n}\nfunction renderDirective(elem) {\n return `<${elem.data}>`;\n}\nfunction renderText(elem, opts) {\n var _a;\n let data = elem.data || \"\";\n // If entities weren't decoded, no need to encode them back\n if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&\n !(!opts.xmlMode &&\n elem.parent &&\n unencodedElements.has(elem.parent.name))) {\n data =\n opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? encodeXML(data)\n : escapeText(data);\n }\n return data;\n}\nfunction renderCdata(elem) {\n return `<![CDATA[${elem.children[0].data}]]>`;\n}\nfunction renderComment(elem) {\n return `<!--${elem.data}-->`;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAYA,MAAM,oBAAoB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACH;AACD,SAAS,cAAc,OAAO;AAC1B,QAAO,MAAM,QAAQ,MAAM,SAAS;AACvC;;;;AAID,SAAS,iBAAiB,YAAY,MAAM;CACxC,IAAI;AACJ,KAAI,CAAC,WACD;CACJ,MAAM,WAAW,KAAK,KAAK,oBAAoB,QAAQ,OAAO,KAAK,IAAI,KAAK,KAAK,oBAAoB,QAC/F,gBACA,KAAK,WAAW,KAAK,mBAAmB,SACpC,YACA;AACV,QAAO,OAAO,KAAK,WAAW,CACzB,IAAI,CAAC,QAAQ;EACd,IAAIA,MAAI;EACR,MAAM,SAASA,OAAK,WAAW,UAAU,QAAQA,SAAO,KAAK,IAAIA,OAAK;AACtE,MAAI,KAAK,YAAY,WAEjB,OAAO,KAAK,eAAe,IAAI,IAAI,MAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;AAE1E,MAAI,CAAC,KAAK,cAAc,CAAC,KAAK,WAAW,UAAU,GAC/C,QAAO;AAEX,SAAO,GAAG,IAAI,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;CACrC,EAAC,CACG,KAAK,IAAI;AACjB;;;;AAID,MAAM,YAAY,IAAI,IAAI;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA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AW,MACxB,KAAK,UAEE,KAAK,oBAAoB,QAEzB,KAAK,mBAAmB,UAAU,IAAI,KAAK,KAAK,GAAG;AAC3D,MAAI,CAAC,KAAK,SACN,OAAO;EACX,OAAO;CACV,OACI;EACD,OAAO;AACP,MAAI,KAAK,SAAS,SAAS,GACvB,OAAO,OAAO,KAAK,UAAU,KAAK;AAEtC,MAAI,KAAK,WAAW,CAAC,UAAU,IAAI,KAAK,KAAK,EACzC,OAAO,CAAC,EAAE,EAAE,KAAK,KAAK,CAAC,CAAC;CAE/B;AACD,QAAO;AACV;AACD,SAAS,gBAAgB,MAAM;AAC3B,QAAO,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;AAC1B;AACD,SAAS,WAAW,MAAM,MAAM;CAC5B,IAAI;CACJ,IAAI,OAAO,KAAK,QAAQ;AAExB,OAAM,KAAK,KAAK,oBAAoB,QAAQ,OAAO,KAAK,IAAI,KAAK,KAAK,oBAAoB,SACtF,EAAE,CAAC,KAAK,WACJ,KAAK,UACL,kBAAkB,IAAI,KAAK,OAAO,KAAK,GAC3C,OACI,KAAK,WAAW,KAAK,mBAAmB,SAClC,UAAU,KAAK,GACf,WAAW,KAAK;AAE9B,QAAO;AACV;AACD,SAAS,YAAY,MAAM;AACvB,QAAO,CAAC,SAAS,EAAE,KAAK,SAAS,GAAG,KAAK,GAAG,CAAC;AAChD;AACD,SAAS,cAAc,MAAM;AACzB,QAAO,CAAC,IAAI,EAAE,KAAK,KAAK,GAAG,CAAC;AAC/B"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../../../node_modules/domelementtype/lib/esm/index.js
|
|
2
2
|
/** Types of elements found in htmlparser2's DOM */
|
|
3
3
|
var ElementType;
|
|
4
|
-
(function(ElementType) {
|
|
4
|
+
(function(ElementType$1) {
|
|
5
5
|
/** Type for the root element of a document */
|
|
6
|
-
ElementType["Root"] = "root";
|
|
6
|
+
ElementType$1["Root"] = "root";
|
|
7
7
|
/** Type for Text */
|
|
8
|
-
ElementType["Text"] = "text";
|
|
8
|
+
ElementType$1["Text"] = "text";
|
|
9
9
|
/** Type for <? ... ?> */
|
|
10
|
-
ElementType["Directive"] = "directive";
|
|
10
|
+
ElementType$1["Directive"] = "directive";
|
|
11
11
|
/** Type for <!-- ... --> */
|
|
12
|
-
ElementType["Comment"] = "comment";
|
|
12
|
+
ElementType$1["Comment"] = "comment";
|
|
13
13
|
/** Type for <script> tags */
|
|
14
|
-
ElementType["Script"] = "script";
|
|
14
|
+
ElementType$1["Script"] = "script";
|
|
15
15
|
/** Type for <style> tags */
|
|
16
|
-
ElementType["Style"] = "style";
|
|
16
|
+
ElementType$1["Style"] = "style";
|
|
17
17
|
/** Type for Any tag */
|
|
18
|
-
ElementType["Tag"] = "tag";
|
|
18
|
+
ElementType$1["Tag"] = "tag";
|
|
19
19
|
/** Type for <![CDATA[ ... ]]> */
|
|
20
|
-
ElementType["CDATA"] = "cdata";
|
|
20
|
+
ElementType$1["CDATA"] = "cdata";
|
|
21
21
|
/** Type for <!doctype ...> */
|
|
22
|
-
ElementType["Doctype"] = "doctype";
|
|
22
|
+
ElementType$1["Doctype"] = "doctype";
|
|
23
23
|
})(ElementType || (ElementType = {}));
|
|
24
24
|
/**
|
|
25
25
|
* Tests whether an element is a tag or not.
|
|
@@ -47,7 +47,7 @@ const Tag = ElementType.Tag;
|
|
|
47
47
|
const CDATA = ElementType.CDATA;
|
|
48
48
|
/** Type for <!doctype ...> */
|
|
49
49
|
const Doctype = ElementType.Doctype;
|
|
50
|
+
|
|
50
51
|
//#endregion
|
|
51
52
|
export { CDATA, Comment, Directive, Doctype, ElementType, Root, Script, Style, Tag, Text, isTag };
|
|
52
|
-
|
|
53
53
|
//# sourceMappingURL=index.js.map
|