@decocms/blocks 8.1.0-next.0 → 8.1.0-next.2
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/bin/deco.js +5 -12
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/assets.d.ts +46 -0
- package/dist/protocol/assets.d.ts.map +1 -0
- package/dist/protocol/assets.js +105 -0
- package/dist/protocol/assets.js.map +1 -0
- package/dist/protocol/canonical.d.ts +8 -0
- package/dist/protocol/canonical.d.ts.map +1 -0
- package/dist/protocol/canonical.js +8 -0
- package/dist/protocol/canonical.js.map +1 -0
- package/dist/protocol/ciphertext.d.ts +7 -0
- package/dist/protocol/ciphertext.d.ts.map +1 -0
- package/dist/protocol/ciphertext.js +7 -0
- package/dist/protocol/ciphertext.js.map +1 -0
- package/dist/protocol/client.d.ts +54 -0
- package/dist/protocol/client.d.ts.map +1 -0
- package/dist/protocol/client.js +104 -0
- package/dist/protocol/client.js.map +1 -0
- package/dist/protocol/conformance/cases/assets.d.ts +3 -0
- package/dist/protocol/conformance/cases/assets.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/assets.js +71 -0
- package/dist/protocol/conformance/cases/assets.js.map +1 -0
- package/dist/protocol/conformance/cases/guards.d.ts +3 -0
- package/dist/protocol/conformance/cases/guards.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/guards.js +265 -0
- package/dist/protocol/conformance/cases/guards.js.map +1 -0
- package/dist/protocol/conformance/cases/reads.d.ts +3 -0
- package/dist/protocol/conformance/cases/reads.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/reads.js +140 -0
- package/dist/protocol/conformance/cases/reads.js.map +1 -0
- package/dist/protocol/conformance/cases/types.d.ts +9 -0
- package/dist/protocol/conformance/cases/types.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/types.js +2 -0
- package/dist/protocol/conformance/cases/types.js.map +1 -0
- package/dist/protocol/conformance/cases/wire.d.ts +3 -0
- package/dist/protocol/conformance/cases/wire.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/wire.js +130 -0
- package/dist/protocol/conformance/cases/wire.js.map +1 -0
- package/dist/protocol/conformance/cases/writes.d.ts +3 -0
- package/dist/protocol/conformance/cases/writes.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/writes.js +278 -0
- package/dist/protocol/conformance/cases/writes.js.map +1 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts +22 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts.map +1 -0
- package/dist/protocol/conformance/contentHashFixtures.js +64 -0
- package/dist/protocol/conformance/contentHashFixtures.js.map +1 -0
- package/dist/protocol/conformance/context.d.ts +100 -0
- package/dist/protocol/conformance/context.d.ts.map +1 -0
- package/dist/protocol/conformance/context.js +155 -0
- package/dist/protocol/conformance/context.js.map +1 -0
- package/dist/protocol/conformance/index.d.ts +32 -0
- package/dist/protocol/conformance/index.d.ts.map +1 -0
- package/dist/protocol/conformance/index.js +90 -0
- package/dist/protocol/conformance/index.js.map +1 -0
- package/dist/protocol/errors.d.ts +85 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +62 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/index.d.ts +25 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +25 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/keys.d.ts +101 -0
- package/dist/protocol/keys.d.ts.map +1 -0
- package/dist/protocol/keys.js +223 -0
- package/dist/protocol/keys.js.map +1 -0
- package/dist/protocol/params.d.ts +10 -0
- package/dist/protocol/params.d.ts.map +1 -0
- package/dist/protocol/params.js +54 -0
- package/dist/protocol/params.js.map +1 -0
- package/dist/protocol/secrets.d.ts +22 -0
- package/dist/protocol/secrets.d.ts.map +1 -0
- package/dist/protocol/secrets.js +200 -0
- package/dist/protocol/secrets.js.map +1 -0
- package/dist/protocol/server/assets.d.ts +20 -0
- package/dist/protocol/server/assets.d.ts.map +1 -0
- package/dist/protocol/server/assets.js +77 -0
- package/dist/protocol/server/assets.js.map +1 -0
- package/dist/protocol/server/auth.d.ts +31 -0
- package/dist/protocol/server/auth.d.ts.map +1 -0
- package/dist/protocol/server/auth.js +32 -0
- package/dist/protocol/server/auth.js.map +1 -0
- package/dist/protocol/server/bodyCache.d.ts +28 -0
- package/dist/protocol/server/bodyCache.d.ts.map +1 -0
- package/dist/protocol/server/bodyCache.js +75 -0
- package/dist/protocol/server/bodyCache.js.map +1 -0
- package/dist/protocol/server/content.d.ts +44 -0
- package/dist/protocol/server/content.d.ts.map +1 -0
- package/dist/protocol/server/content.js +132 -0
- package/dist/protocol/server/content.js.map +1 -0
- package/dist/protocol/server/core.d.ts +63 -0
- package/dist/protocol/server/core.d.ts.map +1 -0
- package/dist/protocol/server/core.js +77 -0
- package/dist/protocol/server/core.js.map +1 -0
- package/dist/protocol/server/handler.d.ts +5 -0
- package/dist/protocol/server/handler.d.ts.map +1 -0
- package/dist/protocol/server/handler.js +70 -0
- package/dist/protocol/server/handler.js.map +1 -0
- package/dist/protocol/server/http.d.ts +24 -0
- package/dist/protocol/server/http.d.ts.map +1 -0
- package/dist/protocol/server/http.js +133 -0
- package/dist/protocol/server/http.js.map +1 -0
- package/dist/protocol/server/index.d.ts +11 -0
- package/dist/protocol/server/index.d.ts.map +1 -0
- package/dist/protocol/server/index.js +9 -0
- package/dist/protocol/server/index.js.map +1 -0
- package/dist/protocol/server/methods/apply.d.ts +4 -0
- package/dist/protocol/server/methods/apply.d.ts.map +1 -0
- package/dist/protocol/server/methods/apply.js +275 -0
- package/dist/protocol/server/methods/apply.js.map +1 -0
- package/dist/protocol/server/methods/read.d.ts +14 -0
- package/dist/protocol/server/methods/read.d.ts.map +1 -0
- package/dist/protocol/server/methods/read.js +132 -0
- package/dist/protocol/server/methods/read.js.map +1 -0
- package/dist/protocol/server/rpc.d.ts +7 -0
- package/dist/protocol/server/rpc.d.ts.map +1 -0
- package/dist/protocol/server/rpc.js +115 -0
- package/dist/protocol/server/rpc.js.map +1 -0
- package/dist/protocol/storage/fs/hash.d.ts +8 -0
- package/dist/protocol/storage/fs/hash.d.ts.map +1 -0
- package/dist/protocol/storage/fs/hash.js +20 -0
- package/dist/protocol/storage/fs/hash.js.map +1 -0
- package/dist/protocol/storage/fs/index.d.ts +30 -0
- package/dist/protocol/storage/fs/index.d.ts.map +1 -0
- package/dist/protocol/storage/fs/index.js +301 -0
- package/dist/protocol/storage/fs/index.js.map +1 -0
- package/dist/protocol/storage/fs/lock.d.ts +8 -0
- package/dist/protocol/storage/fs/lock.d.ts.map +1 -0
- package/dist/protocol/storage/fs/lock.js +61 -0
- package/dist/protocol/storage/fs/lock.js.map +1 -0
- package/dist/protocol/storage/fs/transaction.d.ts +19 -0
- package/dist/protocol/storage/fs/transaction.d.ts.map +1 -0
- package/dist/protocol/storage/fs/transaction.js +174 -0
- package/dist/protocol/storage/fs/transaction.js.map +1 -0
- package/dist/protocol/storage/fs/unsupported.d.ts +10 -0
- package/dist/protocol/storage/fs/unsupported.d.ts.map +1 -0
- package/dist/protocol/storage/fs/unsupported.js +4 -0
- package/dist/protocol/storage/fs/unsupported.js.map +1 -0
- package/dist/protocol/storage/memory.d.ts +40 -0
- package/dist/protocol/storage/memory.d.ts.map +1 -0
- package/dist/protocol/storage/memory.js +179 -0
- package/dist/protocol/storage/memory.js.map +1 -0
- package/dist/protocol/storage.d.ts +178 -0
- package/dist/protocol/storage.d.ts.map +1 -0
- package/dist/protocol/storage.js +29 -0
- package/dist/protocol/storage.js.map +1 -0
- package/dist/protocol/types.d.ts +194 -0
- package/dist/protocol/types.d.ts.map +1 -0
- package/dist/protocol/types.js +31 -0
- package/dist/protocol/types.js.map +1 -0
- package/dist/v8/analytics.d.ts +31 -0
- package/dist/v8/analytics.d.ts.map +1 -0
- package/dist/v8/analytics.js +46 -0
- package/dist/v8/analytics.js.map +1 -0
- package/dist/v8/background.d.ts +26 -0
- package/dist/v8/background.d.ts.map +1 -0
- package/dist/v8/background.js +95 -0
- package/dist/v8/background.js.map +1 -0
- package/dist/v8/builtins/data.d.ts +15 -0
- package/dist/v8/builtins/data.d.ts.map +1 -0
- package/dist/v8/builtins/data.js +18 -0
- package/dist/v8/builtins/data.js.map +1 -0
- package/dist/v8/builtins/index.d.ts +9 -0
- package/dist/v8/builtins/index.d.ts.map +1 -0
- package/dist/v8/builtins/index.js +24 -0
- package/dist/v8/builtins/index.js.map +1 -0
- package/dist/v8/builtins/lazy.d.ts +17 -0
- package/dist/v8/builtins/lazy.d.ts.map +1 -0
- package/dist/v8/builtins/lazy.js +13 -0
- package/dist/v8/builtins/lazy.js.map +1 -0
- package/dist/v8/builtins/legacy.d.ts +41 -0
- package/dist/v8/builtins/legacy.d.ts.map +1 -0
- package/dist/v8/builtins/legacy.js +62 -0
- package/dist/v8/builtins/legacy.js.map +1 -0
- package/dist/v8/builtins/matchers.d.ts +19 -0
- package/dist/v8/builtins/matchers.d.ts.map +1 -0
- package/dist/v8/builtins/matchers.js +24 -0
- package/dist/v8/builtins/matchers.js.map +1 -0
- package/dist/v8/builtins/multivariate.d.ts +15 -0
- package/dist/v8/builtins/multivariate.d.ts.map +1 -0
- package/dist/v8/builtins/multivariate.js +18 -0
- package/dist/v8/builtins/multivariate.js.map +1 -0
- package/dist/v8/builtins/secret.d.ts +7 -0
- package/dist/v8/builtins/secret.d.ts.map +1 -0
- package/dist/v8/builtins/secret.js +68 -0
- package/dist/v8/builtins/secret.js.map +1 -0
- package/dist/v8/canonical.d.ts +42 -0
- package/dist/v8/canonical.d.ts.map +1 -0
- package/dist/v8/canonical.js +111 -0
- package/dist/v8/canonical.js.map +1 -0
- package/dist/v8/ciphertext.d.ts +58 -0
- package/dist/v8/ciphertext.d.ts.map +1 -0
- package/dist/v8/ciphertext.js +134 -0
- package/dist/v8/ciphertext.js.map +1 -0
- package/dist/v8/cli/builtins.d.ts +11 -0
- package/dist/v8/cli/builtins.d.ts.map +1 -0
- package/dist/v8/cli/builtins.js +18 -0
- package/dist/v8/cli/builtins.js.map +1 -0
- package/dist/v8/cli/check/index.d.ts +41 -0
- package/dist/v8/cli/check/index.d.ts.map +1 -0
- package/dist/v8/cli/check/index.js +713 -0
- package/dist/v8/cli/check/index.js.map +1 -0
- package/dist/v8/cli/check/messages.d.ts +24 -0
- package/dist/v8/cli/check/messages.d.ts.map +1 -0
- package/dist/v8/cli/check/messages.js +150 -0
- package/dist/v8/cli/check/messages.js.map +1 -0
- package/dist/v8/cli/content.d.ts +60 -0
- package/dist/v8/cli/content.d.ts.map +1 -0
- package/dist/v8/cli/content.js +231 -0
- package/dist/v8/cli/content.js.map +1 -0
- package/dist/v8/cli/index.d.ts +18 -0
- package/dist/v8/cli/index.d.ts.map +1 -0
- package/dist/v8/cli/index.js +18 -0
- package/dist/v8/cli/index.js.map +1 -0
- package/dist/v8/cli/log.d.ts +9 -0
- package/dist/v8/cli/log.d.ts.map +1 -0
- package/dist/v8/cli/log.js +11 -0
- package/dist/v8/cli/log.js.map +1 -0
- package/dist/v8/cli/main.d.ts +2 -0
- package/dist/v8/cli/main.d.ts.map +1 -0
- package/dist/v8/cli/main.js +9 -0
- package/dist/v8/cli/main.js.map +1 -0
- package/dist/v8/cli/root.d.ts +28 -0
- package/dist/v8/cli/root.d.ts.map +1 -0
- package/dist/v8/cli/root.js +64 -0
- package/dist/v8/cli/root.js.map +1 -0
- package/dist/v8/cli/run.d.ts +13 -0
- package/dist/v8/cli/run.d.ts.map +1 -0
- package/dist/v8/cli/run.js +210 -0
- package/dist/v8/cli/run.js.map +1 -0
- package/dist/v8/cli/schema/builtinSchemas.d.ts +22 -0
- package/dist/v8/cli/schema/builtinSchemas.d.ts.map +1 -0
- package/dist/v8/cli/schema/builtinSchemas.js +213 -0
- package/dist/v8/cli/schema/builtinSchemas.js.map +1 -0
- package/dist/v8/cli/schema/generate.d.ts +50 -0
- package/dist/v8/cli/schema/generate.d.ts.map +1 -0
- package/dist/v8/cli/schema/generate.js +415 -0
- package/dist/v8/cli/schema/generate.js.map +1 -0
- package/dist/v8/cli/schema/index.d.ts +21 -0
- package/dist/v8/cli/schema/index.d.ts.map +1 -0
- package/dist/v8/cli/schema/index.js +51 -0
- package/dist/v8/cli/schema/index.js.map +1 -0
- package/dist/v8/cli/schema/tsProgram.d.ts +120 -0
- package/dist/v8/cli/schema/tsProgram.d.ts.map +1 -0
- package/dist/v8/cli/schema/tsProgram.js +418 -0
- package/dist/v8/cli/schema/tsProgram.js.map +1 -0
- package/dist/v8/cli/schema/typeToSchema.d.ts +81 -0
- package/dist/v8/cli/schema/typeToSchema.d.ts.map +1 -0
- package/dist/v8/cli/schema/typeToSchema.js +683 -0
- package/dist/v8/cli/schema/typeToSchema.js.map +1 -0
- package/dist/v8/cli/serve/server.d.ts +31 -0
- package/dist/v8/cli/serve/server.d.ts.map +1 -0
- package/dist/v8/cli/serve/server.js +247 -0
- package/dist/v8/cli/serve/server.js.map +1 -0
- package/dist/v8/cli/watch.d.ts +20 -0
- package/dist/v8/cli/watch.d.ts.map +1 -0
- package/dist/v8/cli/watch.js +79 -0
- package/dist/v8/cli/watch.js.map +1 -0
- package/dist/v8/client.d.ts +20 -0
- package/dist/v8/client.d.ts.map +1 -0
- package/dist/v8/client.js +115 -0
- package/dist/v8/client.js.map +1 -0
- package/dist/v8/cms.d.ts +9 -0
- package/dist/v8/cms.d.ts.map +1 -0
- package/dist/v8/cms.js +206 -0
- package/dist/v8/cms.js.map +1 -0
- package/dist/v8/content.d.ts +35 -0
- package/dist/v8/content.d.ts.map +1 -0
- package/dist/v8/content.js +183 -0
- package/dist/v8/content.js.map +1 -0
- package/dist/v8/draft.d.ts +44 -0
- package/dist/v8/draft.d.ts.map +1 -0
- package/dist/v8/draft.js +133 -0
- package/dist/v8/draft.js.map +1 -0
- package/dist/v8/errors.d.ts +21 -0
- package/dist/v8/errors.d.ts.map +1 -0
- package/dist/v8/errors.js +39 -0
- package/dist/v8/errors.js.map +1 -0
- package/dist/v8/fetch.d.ts +26 -0
- package/dist/v8/fetch.d.ts.map +1 -0
- package/dist/v8/fetch.js +98 -0
- package/dist/v8/fetch.js.map +1 -0
- package/dist/v8/identity.d.ts +19 -0
- package/dist/v8/identity.d.ts.map +1 -0
- package/dist/v8/identity.js +54 -0
- package/dist/v8/identity.js.map +1 -0
- package/dist/v8/index.d.ts +11 -0
- package/dist/v8/index.d.ts.map +1 -0
- package/dist/v8/index.js +10 -0
- package/dist/v8/index.js.map +1 -0
- package/dist/v8/json.d.ts +19 -0
- package/dist/v8/json.d.ts.map +1 -0
- package/dist/v8/json.js +65 -0
- package/dist/v8/json.js.map +1 -0
- package/dist/v8/matchRoute.d.ts +30 -0
- package/dist/v8/matchRoute.d.ts.map +1 -0
- package/dist/v8/matchRoute.js +175 -0
- package/dist/v8/matchRoute.js.map +1 -0
- package/dist/v8/remoteLoader.d.ts +16 -0
- package/dist/v8/remoteLoader.d.ts.map +1 -0
- package/dist/v8/remoteLoader.js +243 -0
- package/dist/v8/remoteLoader.js.map +1 -0
- package/dist/v8/resolver.d.ts +34 -0
- package/dist/v8/resolver.d.ts.map +1 -0
- package/dist/v8/resolver.js +219 -0
- package/dist/v8/resolver.js.map +1 -0
- package/dist/v8/secrets.d.ts +9 -0
- package/dist/v8/secrets.d.ts.map +1 -0
- package/dist/v8/secrets.js +14 -0
- package/dist/v8/secrets.js.map +1 -0
- package/dist/v8/telemetry.d.ts +61 -0
- package/dist/v8/telemetry.d.ts.map +1 -0
- package/dist/v8/telemetry.js +460 -0
- package/dist/v8/telemetry.js.map +1 -0
- package/dist/v8/types.d.ts +214 -0
- package/dist/v8/types.d.ts.map +1 -0
- package/dist/v8/types.js +2 -0
- package/dist/v8/types.js.map +1 -0
- package/package.json +65 -105
- package/src/index.ts +3 -13
- package/src/protocol/canonical.ts +1 -1
- package/src/protocol/ciphertext.ts +1 -1
- package/src/protocol/client.ts +2 -2
- package/src/protocol/conformance/cases/assets.ts +3 -3
- package/src/protocol/conformance/cases/guards.ts +4 -4
- package/src/protocol/conformance/cases/reads.ts +4 -4
- package/src/protocol/conformance/cases/types.ts +1 -1
- package/src/protocol/conformance/cases/wire.ts +4 -4
- package/src/protocol/conformance/cases/writes.ts +4 -4
- package/src/protocol/conformance/context.ts +4 -4
- package/src/protocol/conformance/index.ts +10 -10
- package/src/protocol/index.ts +6 -6
- package/src/protocol/params.ts +2 -2
- package/src/protocol/secrets.ts +3 -3
- package/src/protocol/server/assets.ts +6 -6
- package/src/protocol/server/auth.ts +1 -1
- package/src/protocol/server/content.ts +5 -5
- package/src/protocol/server/core.ts +12 -6
- package/src/protocol/server/handler.ts +6 -6
- package/src/protocol/server/http.ts +1 -1
- package/src/protocol/server/index.ts +3 -3
- package/src/protocol/server/methods/apply.ts +9 -9
- package/src/protocol/server/methods/read.ts +5 -5
- package/src/protocol/server/rpc.ts +6 -6
- package/src/protocol/storage/fs/index.ts +7 -7
- package/src/protocol/storage/fs/lock.ts +1 -1
- package/src/protocol/storage/fs/unsupported.ts +2 -2
- package/src/protocol/storage/memory.ts +5 -5
- package/src/protocol/storage.ts +1 -1
- package/src/v8/analytics.ts +2 -2
- package/src/v8/background.ts +3 -3
- package/src/v8/builtins/data.ts +1 -1
- package/src/v8/builtins/index.ts +6 -6
- package/src/v8/builtins/lazy.ts +1 -1
- package/src/v8/builtins/legacy.ts +2 -2
- package/src/v8/builtins/multivariate.ts +1 -1
- package/src/v8/builtins/secret.ts +2 -2
- package/src/v8/cli/builtins.ts +2 -2
- package/src/v8/cli/check/index.ts +11 -11
- package/src/v8/cli/content.ts +6 -6
- package/src/v8/cli/index.ts +8 -8
- package/src/v8/cli/main.ts +1 -1
- package/src/v8/cli/run.ts +7 -7
- package/src/v8/cli/schema/builtinSchemas.ts +1 -1
- package/src/v8/cli/schema/generate.ts +6 -6
- package/src/v8/cli/schema/index.ts +4 -4
- package/src/v8/cli/schema/tsProgram.ts +1 -1
- package/src/v8/cli/schema/typeToSchema.ts +24 -2
- package/src/v8/cli/serve/server.ts +9 -9
- package/src/v8/client.ts +5 -5
- package/src/v8/cms.ts +9 -9
- package/src/v8/content.ts +4 -4
- package/src/v8/draft.ts +1 -1
- package/src/v8/errors.ts +1 -1
- package/src/v8/fetch.ts +9 -28
- package/src/v8/identity.ts +1 -1
- package/src/v8/index.ts +5 -5
- package/src/v8/matchRoute.ts +1 -1
- package/src/v8/remoteLoader.ts +7 -7
- package/src/v8/resolver.ts +6 -6
- package/src/v8/secrets.ts +1 -1
- package/src/v8/telemetry.ts +6 -6
- package/src/cms/applySectionConventions.ts +0 -148
- package/src/cms/blockSource.ts +0 -228
- package/src/cms/client.ts +0 -85
- package/src/cms/deferredTrigger.ts +0 -58
- package/src/cms/draftSource.ts +0 -476
- package/src/cms/index.ts +0 -180
- package/src/cms/loadDecofileDirectory.ts +0 -89
- package/src/cms/loader.ts +0 -563
- package/src/cms/registry.ts +0 -264
- package/src/cms/renderJson.ts +0 -179
- package/src/cms/resolve.ts +0 -2583
- package/src/cms/schema.ts +0 -1219
- package/src/cms/sectionLoaderContext.ts +0 -113
- package/src/cms/sectionLoaders.ts +0 -686
- package/src/cms/sectionMixins.ts +0 -153
- package/src/flags/audience.ts +0 -56
- package/src/flags/everyone.ts +0 -29
- package/src/flags/flag.ts +0 -15
- package/src/flags/multivariate/image.ts +0 -11
- package/src/flags/multivariate/message.ts +0 -11
- package/src/flags/multivariate/page.ts +0 -16
- package/src/flags/multivariate/section.ts +0 -16
- package/src/flags/multivariate.ts +0 -1
- package/src/flags/types.ts +0 -59
- package/src/flags/utils/multivariate.ts +0 -20
- package/src/hooks/Image.tsx +0 -314
- package/src/hooks/JsonLd.tsx +0 -353
- package/src/hooks/LazySection.tsx +0 -121
- package/src/hooks/LiveControls.tsx +0 -144
- package/src/hooks/Picture.tsx +0 -127
- package/src/hooks/RenderSection.tsx +0 -91
- package/src/hooks/SectionErrorFallback.tsx +0 -97
- package/src/hooks/Stats.tsx +0 -134
- package/src/hooks/index.ts +0 -35
- package/src/hooks/useLoadMore.ts +0 -100
- package/src/matchers/builtins.ts +0 -459
- package/src/matchers/countryNames.ts +0 -104
- package/src/matchers/override.ts +0 -136
- package/src/matchers/posthog.ts +0 -154
- package/src/middleware/decoState.ts +0 -55
- package/src/middleware/healthMetrics.ts +0 -133
- package/src/middleware/hydrationContext.ts +0 -79
- package/src/middleware/index.ts +0 -88
- package/src/middleware/liveness.ts +0 -21
- package/src/middleware/observability.ts +0 -800
- package/src/middleware/validateSection.ts +0 -100
- package/src/preview/DraftPreviewBadge.tsx +0 -306
- package/src/preview/decoMark.ts +0 -11
- package/src/preview/index.ts +0 -8
- package/src/sdk/abTesting.ts +0 -556
- package/src/sdk/analytics.ts +0 -147
- package/src/sdk/cacheHeaders.ts +0 -633
- package/src/sdk/cacheStorage.ts +0 -287
- package/src/sdk/cachedLoader.ts +0 -556
- package/src/sdk/clx.ts +0 -5
- package/src/sdk/cn.ts +0 -28
- package/src/sdk/composite.ts +0 -114
- package/src/sdk/cookie.ts +0 -129
- package/src/sdk/crypto.ts +0 -199
- package/src/sdk/csp.ts +0 -59
- package/src/sdk/deepOmit.ts +0 -52
- package/src/sdk/detectDevice.ts +0 -45
- package/src/sdk/djb2.ts +0 -20
- package/src/sdk/encoding.ts +0 -44
- package/src/sdk/env.ts +0 -54
- package/src/sdk/experiments.ts +0 -314
- package/src/sdk/fetchCache.ts +0 -269
- package/src/sdk/fetchTimeout.ts +0 -58
- package/src/sdk/flags.ts +0 -138
- package/src/sdk/http.ts +0 -124
- package/src/sdk/index.ts +0 -97
- package/src/sdk/inflightTimeout.ts +0 -53
- package/src/sdk/instrumentedFetch.ts +0 -362
- package/src/sdk/invoke.ts +0 -298
- package/src/sdk/logger.ts +0 -304
- package/src/sdk/mergeCacheControl.ts +0 -150
- package/src/sdk/nonce.ts +0 -46
- package/src/sdk/normalizeUrls.ts +0 -91
- package/src/sdk/observability.ts +0 -116
- package/src/sdk/otel.ts +0 -1118
- package/src/sdk/otelAdapters/clickhouseCollector.ts +0 -65
- package/src/sdk/otelAdapters.ts +0 -144
- package/src/sdk/otelHttpLog.ts +0 -419
- package/src/sdk/otelHttpMeter.ts +0 -532
- package/src/sdk/otelHttpTracer.ts +0 -543
- package/src/sdk/redirects.ts +0 -336
- package/src/sdk/requestContext.ts +0 -281
- package/src/sdk/requestContextStorage.browser.ts +0 -43
- package/src/sdk/requestContextStorage.ts +0 -35
- package/src/sdk/responseCache.ts +0 -82
- package/src/sdk/retry.ts +0 -45
- package/src/sdk/serverTimings.ts +0 -68
- package/src/sdk/signal.ts +0 -42
- package/src/sdk/sitemap.ts +0 -160
- package/src/sdk/urlRedaction.ts +0 -82
- package/src/sdk/urlUtils.ts +0 -183
- package/src/sdk/useDevice.ts +0 -89
- package/src/sdk/useDeviceContext.tsx +0 -108
- package/src/sdk/useId.ts +0 -7
- package/src/sdk/useScript.ts +0 -210
- package/src/sdk/useSuggestions.ts +0 -188
- package/src/sdk/wrapCaughtErrors.ts +0 -107
- package/src/setup.ts +0 -120
- package/src/types/index.ts +0 -53
- package/src/types/widgets.ts +0 -14
package/src/hooks/Stats.tsx
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stats — deco's first-party analytics collector.
|
|
3
|
-
*
|
|
4
|
-
* MOUNTED BY THE FRAMEWORK. `DecoRootLayout` renders it, so a site turns analytics on with an
|
|
5
|
-
* environment variable and no code change — the same ergonomics the Fresh side already has,
|
|
6
|
-
* where `website/pages/Page.tsx` renders it for every page.
|
|
7
|
-
*
|
|
8
|
-
* It lives in `@decocms/blocks` rather than in `@decocms/apps-website` because of what it is:
|
|
9
|
-
* twenty lines of a `<link>` and a `<script>` driven by environment variables, pointing at our
|
|
10
|
-
* own collector. `OneDollarStats` belongs among the apps because it is a VENDOR integration —
|
|
11
|
-
* it wraps `history`, decodes a cookie and feeds a third party\'s SDK. This is framework
|
|
12
|
-
* infrastructure, and putting it here is also what lets `@decocms/tanstack` mount it without
|
|
13
|
-
* importing from an apps package, which would be a new edge in a dependency graph the repo
|
|
14
|
-
* keeps one-way on purpose.
|
|
15
|
-
*
|
|
16
|
-
* `@decocms/apps-website/components/Stats` re-exports it, so anything importing the old path
|
|
17
|
-
* keeps working.
|
|
18
|
-
*
|
|
19
|
-
* ## Why this is twenty lines and OneDollarStats is three hundred
|
|
20
|
-
*
|
|
21
|
-
* Not because it does less — because the work is on the other side. The lilstts SDK
|
|
22
|
-
* has no notion of SPA navigation the way this app routes, no notion of the
|
|
23
|
-
* `deco_segment` cookie, and no notion of `window.DECO.events`, so the component has
|
|
24
|
-
* to wrap `history.pushState`, poll for globals, read and decode the cookie, and
|
|
25
|
-
* forward every commerce event by hand.
|
|
26
|
-
*
|
|
27
|
-
* The deco collector's own bundle already does all of it, and is tested doing it:
|
|
28
|
-
* the core module takes the first pageview through the prerender guard, wraps
|
|
29
|
-
* `pushState`, `replaceState` and `popstate`, and flushes on `pagehide` and
|
|
30
|
-
* `visibilitychange`; the deco module reads `deco_segment` into experiment
|
|
31
|
-
* assignments and subscribes to `window.DECO.events`, mapping the commerce
|
|
32
|
-
* vocabulary. None of that belongs in a component that would then be a second
|
|
33
|
-
* implementation of it, drifting from the first.
|
|
34
|
-
*
|
|
35
|
-
* So there is no `useEffect` here, and that is the point. Nothing to hydrate, no
|
|
36
|
-
* readiness polling, no module-level guard against StrictMode double-mounting —
|
|
37
|
-
* because there is no client state to guard.
|
|
38
|
-
*
|
|
39
|
-
* ## data- attributes, not a global
|
|
40
|
-
*
|
|
41
|
-
* `dev` and `debug` are read off the tag rather than from `window.__dq`, and this is
|
|
42
|
-
* load-bearing on exactly this framework. TanStack hoists `<script async>` into
|
|
43
|
-
* `<head>` ABOVE any inline configuration block — measured at byte 190 against byte
|
|
44
|
-
* 1108 on a real site. A component that set a global and expected the collector to
|
|
45
|
-
* find it would boot into silence here, with no error: the collector would see a
|
|
46
|
-
* development host, skip, and say nothing. Attributes cannot lose that race because
|
|
47
|
-
* they are on the element that is executing.
|
|
48
|
-
*
|
|
49
|
-
* ## Off by default
|
|
50
|
-
*
|
|
51
|
-
* `DECO_ANALYTICS_ENABLED` must be set to `true`. This is the inverse of
|
|
52
|
-
* `ONEDOLLAR_ENABLED`, which defaults to on, and the asymmetry is deliberate: one is
|
|
53
|
-
* the incumbent and the other is being introduced. The two gates are also
|
|
54
|
-
* independent, so a site can run both during a shadow comparison and neither gate
|
|
55
|
-
* can turn the other off.
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
export interface Props {
|
|
59
|
-
/**
|
|
60
|
-
* Where the collector is published. Empty means same-origin, which is the
|
|
61
|
-
* intended deployment: the script and the beacon are served from the site's own
|
|
62
|
-
* hostname so no third-party request is involved and nothing is blocked.
|
|
63
|
-
*/
|
|
64
|
-
origin?: string;
|
|
65
|
-
/**
|
|
66
|
-
* The site's public key, for sites NOT served through our CDN.
|
|
67
|
-
*
|
|
68
|
-
* Sites behind our edge are identified by the `Host` header, which a visitor
|
|
69
|
-
* cannot forge; those must leave this unset. A key travels in the page source
|
|
70
|
-
* where anyone can read and reuse it, so a key-identified site is recorded with
|
|
71
|
-
* `site_id_source = tag` and is never billed from.
|
|
72
|
-
*/
|
|
73
|
-
siteKey?: string;
|
|
74
|
-
/** `defer` instead of `async`. Only for a page that needs strict ordering. */
|
|
75
|
-
defer?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Collect from localhost. The collector refuses local and private hostnames by
|
|
78
|
-
* default, which is why a developer sees nothing until this is on.
|
|
79
|
-
*/
|
|
80
|
-
dev?: boolean;
|
|
81
|
-
/** Log every queued and flushed batch to the console. */
|
|
82
|
-
debug?: boolean;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** Same-origin. See {@link Props.origin}. */
|
|
86
|
-
export const DEFAULT_ORIGIN = "";
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Opt-in, and independent of `ONEDOLLAR_ENABLED` so both can run at once.
|
|
90
|
-
*/
|
|
91
|
-
const DECO_ANALYTICS_ENABLED = process.env.DECO_ANALYTICS_ENABLED === "true";
|
|
92
|
-
const DECO_ANALYTICS_ORIGIN = process.env.DECO_ANALYTICS_ORIGIN;
|
|
93
|
-
const DECO_ANALYTICS_SITE_KEY = process.env.DECO_ANALYTICS_SITE_KEY;
|
|
94
|
-
|
|
95
|
-
function Stats({ origin, siteKey, defer, dev, debug }: Props) {
|
|
96
|
-
if (!DECO_ANALYTICS_ENABLED) return null;
|
|
97
|
-
|
|
98
|
-
const base = origin ?? DECO_ANALYTICS_ORIGIN ?? DEFAULT_ORIGIN;
|
|
99
|
-
const key = siteKey ?? DECO_ANALYTICS_SITE_KEY;
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<>
|
|
103
|
-
{/*
|
|
104
|
-
* Only when the collector is on another origin. A `preconnect` to the page's
|
|
105
|
-
* own origin is a wasted hint at best, and on some browsers it is a second
|
|
106
|
-
* connection opened for nothing.
|
|
107
|
-
*/}
|
|
108
|
-
{base ? <link rel="preconnect" href={base} crossOrigin="anonymous" /> : null}
|
|
109
|
-
<script
|
|
110
|
-
id="deco-analytics"
|
|
111
|
-
async={!defer}
|
|
112
|
-
defer={defer}
|
|
113
|
-
// THE KEY GOES IN THE URL, not in a `data-` attribute. The collector resolves the
|
|
114
|
-
// site server-side while RENDERING the bundle -- it reads `?k=` and writes the
|
|
115
|
-
// resolved config into the script it returns -- so a key on the element arrives
|
|
116
|
-
// far too late to matter. It is also never read: the bundle only looks at
|
|
117
|
-
// `data-dev` and `data-debug`.
|
|
118
|
-
//
|
|
119
|
-
// This was `data-site` and it would have failed the way this project's failures
|
|
120
|
-
// always do: the collector resolves nothing, serves the `s:"unknown"` fallback,
|
|
121
|
-
// and the site collects exactly zero with no error anywhere. Same shape as the
|
|
122
|
-
// bug that once made the entire self-serve tier silent.
|
|
123
|
-
src={`${base}/_dq/a.js${key ? `?k=${encodeURIComponent(key)}` : ""}`}
|
|
124
|
-
// Rendered only when true. `data-dev="false"` and an absent attribute mean
|
|
125
|
-
// the same thing to the collector, and the absent one cannot be mistaken
|
|
126
|
-
// for a deliberate setting by someone reading the page source.
|
|
127
|
-
data-dev={dev ? "true" : undefined}
|
|
128
|
-
data-debug={debug ? "true" : undefined}
|
|
129
|
-
/>
|
|
130
|
-
</>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export default Stats;
|
package/src/hooks/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export { isBelowFold, LazySection, type LazySectionProps } from "./LazySection";
|
|
2
|
-
export { LiveControls } from "./LiveControls";
|
|
3
|
-
export { default as Stats, DEFAULT_ORIGIN as STATS_DEFAULT_ORIGIN, type Props as StatsProps } from "./Stats";
|
|
4
|
-
export { SectionErrorBoundary } from "./SectionErrorFallback";
|
|
5
|
-
export { default as RenderSection } from "./RenderSection";
|
|
6
|
-
|
|
7
|
-
// Commerce UI primitives (moved from apps-start's commerce/components/).
|
|
8
|
-
export {
|
|
9
|
-
default as Image,
|
|
10
|
-
registerImageCdnDomain,
|
|
11
|
-
getImageCdnDomain,
|
|
12
|
-
registerImageQuality,
|
|
13
|
-
getImageQuality,
|
|
14
|
-
getOptimizedMediaUrl,
|
|
15
|
-
getSrcSet,
|
|
16
|
-
FACTORS,
|
|
17
|
-
type ImageProps,
|
|
18
|
-
type ImageQuality,
|
|
19
|
-
type FitOptions,
|
|
20
|
-
} from "./Image";
|
|
21
|
-
export { Picture, Source, type PictureProps, type SourceProps } from "./Picture";
|
|
22
|
-
export { useLoadMore } from "./useLoadMore";
|
|
23
|
-
export {
|
|
24
|
-
ProductJsonLd,
|
|
25
|
-
PLPJsonLd,
|
|
26
|
-
BreadcrumbJsonLd,
|
|
27
|
-
seoMetaTags,
|
|
28
|
-
type ProductJsonLdProps,
|
|
29
|
-
type PLPJsonLdProps,
|
|
30
|
-
type BreadcrumbJsonLdProps,
|
|
31
|
-
type SeoMetaProps,
|
|
32
|
-
type JsonLdProduct,
|
|
33
|
-
type JsonLdProductListingPage,
|
|
34
|
-
type JsonLdBreadcrumbList,
|
|
35
|
-
} from "./JsonLd";
|
package/src/hooks/useLoadMore.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect, useCallback, useRef } from "react";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Extract the next-page URL from a loader result.
|
|
7
|
-
* Handles both conventions used by commerce loaders:
|
|
8
|
-
* - pageInfo.nextPage (VTEX, Blog, most standard loaders)
|
|
9
|
-
* - nextPage (flat, some legacy loaders)
|
|
10
|
-
*/
|
|
11
|
-
export function getNextPageUrl(data: unknown): string | undefined {
|
|
12
|
-
if (!data || typeof data !== "object") return undefined;
|
|
13
|
-
const d = data as Record<string, unknown>;
|
|
14
|
-
if (d.pageInfo && typeof d.pageInfo === "object") {
|
|
15
|
-
const pi = d.pageInfo as Record<string, unknown>;
|
|
16
|
-
if (typeof pi.nextPage === "string" && pi.nextPage) return pi.nextPage;
|
|
17
|
-
}
|
|
18
|
-
if (typeof d.nextPage === "string" && d.nextPage) return d.nextPage;
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Accumulates pages of loader data for "Ver mais" / load-more pagination.
|
|
24
|
-
*
|
|
25
|
-
* Fresh's `usePartialSection({ mode: "append" })` appended HTML without a
|
|
26
|
-
* page reload. This hook is the TanStack equivalent: it calls the loader
|
|
27
|
-
* via POST /deco/invoke — passing the nextPage URL as `__pageUrl` so the
|
|
28
|
-
* loader reconstructs query, sort, and filter state from it — then pushes
|
|
29
|
-
* the result into local state.
|
|
30
|
-
*
|
|
31
|
-
* Usage in a migrated section:
|
|
32
|
-
* ```tsx
|
|
33
|
-
* "use client"
|
|
34
|
-
* const { pages, loadMore, loading, hasMore, error } = useLoadMore(
|
|
35
|
-
* props.page ?? { products: [], pageInfo: {} },
|
|
36
|
-
* "apps/vtex.ts/loaders/intelligentSearch/productListingPage.ts",
|
|
37
|
-
* pageUrl // resetKey: pass the current page URL so accumulated pages reset on filter/sort change
|
|
38
|
-
* )
|
|
39
|
-
* const allProducts = pages.flatMap(p => p.products ?? [])
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* The component must be `"use client"` because this hook uses useState.
|
|
43
|
-
*
|
|
44
|
-
* @param resetKey - When this value changes, accumulated pages reset to [initial].
|
|
45
|
-
* Pass the current page URL (or any value that changes on filter/sort navigation)
|
|
46
|
-
* to clear the accumulated product list when the user changes filters.
|
|
47
|
-
* Without resetKey, add `key={pageUrl}` to the section element instead.
|
|
48
|
-
*/
|
|
49
|
-
export function useLoadMore<T>(initial: T, loaderKey: string, resetKey?: unknown) {
|
|
50
|
-
const [pages, setPages] = useState<T[]>([initial]);
|
|
51
|
-
const [loading, setLoading] = useState(false);
|
|
52
|
-
const [error, setError] = useState<Error | null>(null);
|
|
53
|
-
// useRef guard prevents two rapid clicks both passing the !loading check
|
|
54
|
-
// before the async state update propagates (React state is not synchronous).
|
|
55
|
-
const inflight = useRef(false);
|
|
56
|
-
// Skip the reset effect on first mount — pages are already seeded from useState.
|
|
57
|
-
const isFirstRender = useRef(true);
|
|
58
|
-
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (isFirstRender.current) {
|
|
61
|
-
isFirstRender.current = false;
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
setPages([initial]);
|
|
65
|
-
setError(null);
|
|
66
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
-
}, [resetKey]);
|
|
68
|
-
|
|
69
|
-
const lastPage = pages[pages.length - 1];
|
|
70
|
-
const nextPageRel = getNextPageUrl(lastPage);
|
|
71
|
-
const hasMore = Boolean(nextPageRel);
|
|
72
|
-
|
|
73
|
-
const loadMore = useCallback(async () => {
|
|
74
|
-
if (!nextPageRel || inflight.current) return;
|
|
75
|
-
inflight.current = true;
|
|
76
|
-
setLoading(true);
|
|
77
|
-
setError(null);
|
|
78
|
-
try {
|
|
79
|
-
const abs = new URL(nextPageRel, location.href);
|
|
80
|
-
const res = await fetch("/deco/invoke", {
|
|
81
|
-
method: "POST",
|
|
82
|
-
headers: { "content-type": "application/json" },
|
|
83
|
-
body: JSON.stringify({
|
|
84
|
-
key: loaderKey,
|
|
85
|
-
props: { __pageUrl: abs.href, __pagePath: abs.pathname },
|
|
86
|
-
}),
|
|
87
|
-
});
|
|
88
|
-
if (!res.ok) throw new Error(`invoke ${res.status} for ${loaderKey}`);
|
|
89
|
-
const next = (await res.json()) as T;
|
|
90
|
-
setPages((prev) => [...prev, next]);
|
|
91
|
-
} catch (e) {
|
|
92
|
-
setError(e instanceof Error ? e : new Error(String(e)));
|
|
93
|
-
} finally {
|
|
94
|
-
inflight.current = false;
|
|
95
|
-
setLoading(false);
|
|
96
|
-
}
|
|
97
|
-
}, [nextPageRel, loaderKey]);
|
|
98
|
-
|
|
99
|
-
return { pages, loadMore, loading, hasMore, error };
|
|
100
|
-
}
|