@valbuild/tanstack 0.150.14 → 0.150.15
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 +6 -0
- package/dist/declarations/src/ValDraft.d.ts +15 -0
- package/dist/declarations/src/server/initValContent.d.ts +3 -1
- package/dist/valbuild-tanstack.cjs.dev.js +39 -6
- package/dist/valbuild-tanstack.cjs.prod.js +39 -6
- package/dist/valbuild-tanstack.esm.js +39 -6
- package/dist/{version-bdc0771e.cjs.prod.js → version-01ac69be.cjs.prod.js} +1 -1
- package/dist/{version-1d325dbd.esm.js → version-0c586fc5.esm.js} +1 -1
- package/dist/{version-24f14005.cjs.dev.js → version-e8454128.cjs.dev.js} +1 -1
- package/package.json +3 -3
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +14 -10
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +14 -10
- package/server/dist/valbuild-tanstack-server.esm.js +14 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @valbuild/tanstack
|
|
2
2
|
|
|
3
|
+
## 0.150.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#986](https://github.com/valbuild/val/pull/986) [`afe3998`](https://github.com/valbuild/val/commit/afe399890afc056961992319254045389e498257) Thanks [@freekh](https://github.com/freekh)! - Content analytics now counts the visitors of a hosted site that has published content without a build. Such a site serves its content as a snapshot, and the analytics script took any snapshot for a proposal's address and never started, so those sites counted nothing even though their content was tagged.
|
|
8
|
+
|
|
3
9
|
## 0.150.14
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -41,4 +41,19 @@ export type ValDraft = {
|
|
|
41
41
|
* only the {@link snapshot}. Absent: a draft, as it always was.
|
|
42
42
|
*/
|
|
43
43
|
draftMode?: false;
|
|
44
|
+
/**
|
|
45
|
+
* `true` at a proposal's address. Not the same as a {@link snapshot}: a
|
|
46
|
+
* site serving a content version -- content published without a build --
|
|
47
|
+
* hands the readers that as a snapshot too, and is the live site. Content
|
|
48
|
+
* analytics counts the live site's visitors and nobody else's, so this is
|
|
49
|
+
* what `ValProvider` asks, never whether there is a snapshot.
|
|
50
|
+
*/
|
|
51
|
+
atProposal?: true;
|
|
44
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Whether the page rendered from `draft` is the live site as a visitor gets
|
|
55
|
+
* it -- what content analytics counts, and nothing else. No draft at all is,
|
|
56
|
+
* and so is one that is only a content version's snapshot. A draft mode
|
|
57
|
+
* render is an editor's, and a proposal's address is not the live site.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isLiveSitePage(draft: ValDraft | null | undefined): boolean;
|
|
@@ -116,7 +116,9 @@ export declare const initFetchValDraft: (valServerPromise: Promise<DraftValServe
|
|
|
116
116
|
/** A proposal's saved Source; see `ValDraft.snapshot`. */
|
|
117
117
|
snapshot?: Snapshot,
|
|
118
118
|
/** What the server's draft starts from; see `ValDraft.base`. */
|
|
119
|
-
base?: Snapshot
|
|
119
|
+
base?: Snapshot,
|
|
120
|
+
/** Whether this serves a proposal's address; see `ValDraft.atProposal`. */
|
|
121
|
+
atProposal?: boolean) => () => Promise<ValDraft | null>;
|
|
120
122
|
declare const initFetchValRouteStega: (config: ValConfig, valApiEndpoints: string, valServerPromise: Promise<RouteReaderValServer>, isEnabled: () => Promise<boolean>, getHeaders: () => Promise<{
|
|
121
123
|
get(name: string): string | null;
|
|
122
124
|
}>, getCookies: () => Promise<{
|
|
@@ -6,7 +6,7 @@ var asyncToGenerator = require('./asyncToGenerator-c3823d62.cjs.dev.js');
|
|
|
6
6
|
var _typeof = require('./typeof-dd0246a1.cjs.dev.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
|
-
var version = require('./version-
|
|
9
|
+
var version = require('./version-e8454128.cjs.dev.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
11
|
var ui = require('@valbuild/ui');
|
|
12
12
|
var reactRouter = require('@tanstack/react-router');
|
|
@@ -1139,6 +1139,35 @@ function shouldSafetyRefresh(state) {
|
|
|
1139
1139
|
return true;
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
|
+
/**
|
|
1143
|
+
* What a draft page shows, read by the server for the request that renders it.
|
|
1144
|
+
*
|
|
1145
|
+
* The source of every module the editor's draft CHANGES -- the ones with
|
|
1146
|
+
* patches applied, published-not-yet-built ones included -- and nothing
|
|
1147
|
+
* else: a module without changes is the build's own source, which the page
|
|
1148
|
+
* already has. Handed to `<ValProvider draft>` so the server's render and the
|
|
1149
|
+
* browser's first render resolve the same text, and the page never shows the
|
|
1150
|
+
* published version first and the draft a moment later.
|
|
1151
|
+
*
|
|
1152
|
+
* A `.jsonValues()` module is in the shape the Studio's own store gives it: the
|
|
1153
|
+
* entries the draft edits hold their content, and every other entry is the
|
|
1154
|
+
* thunkless marker the hooks resolve from the bundle.
|
|
1155
|
+
*
|
|
1156
|
+
* Plain JSON, because it travels from a server function to the browser in the
|
|
1157
|
+
* page's loader data. `fetchValDraft` in `@valbuild/tanstack/server` reads it.
|
|
1158
|
+
*/
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Whether the page rendered from `draft` is the live site as a visitor gets
|
|
1162
|
+
* it -- what content analytics counts, and nothing else. No draft at all is,
|
|
1163
|
+
* and so is one that is only a content version's snapshot. A draft mode
|
|
1164
|
+
* render is an editor's, and a proposal's address is not the live site.
|
|
1165
|
+
*/
|
|
1166
|
+
function isLiveSitePage(draft) {
|
|
1167
|
+
if (draft === null || draft === undefined) return true;
|
|
1168
|
+
return draft.draftMode === false && draft.atProposal !== true;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1142
1171
|
/**
|
|
1143
1172
|
* Content analytics as Val's hosting sets it, for a site whose layout passes
|
|
1144
1173
|
* `<ValProvider>` no `analytics` of its own.
|
|
@@ -1429,6 +1458,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1429
1458
|
var analytics = (analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.enabled) === true;
|
|
1430
1459
|
var contentVersion = analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.contentVersion;
|
|
1431
1460
|
var snapshot = initialDraft === null || initialDraft === void 0 ? void 0 : initialDraft.snapshot;
|
|
1461
|
+
var liveSitePage = isLiveSitePage(initialDraft);
|
|
1432
1462
|
/*
|
|
1433
1463
|
* The base the Studio's overlay must start from, where it is not the
|
|
1434
1464
|
* bundle's (`ValDraft.base`): set while rendering, not in an effect, so it
|
|
@@ -1606,15 +1636,18 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1606
1636
|
* `mountOverlay === false` is "known not to be an editor": no Val enable
|
|
1607
1637
|
* cookie, so no draft mode and no canvas. A page the server rendered from a
|
|
1608
1638
|
* draft is an editor's too, whatever the enable cookie says -- the draft
|
|
1609
|
-
* mode cookie can outlive it. So is one at a proposal's address
|
|
1610
|
-
*
|
|
1611
|
-
* would credit the live site with it.
|
|
1639
|
+
* mode cookie can outlive it. So is one at a proposal's address
|
|
1640
|
+
* (`ValDraft.atProposal`): its content is not published, and counting it
|
|
1641
|
+
* would credit the live site with it. Not "one with a snapshot": a site
|
|
1642
|
+
* serving a content version -- content published without a build -- gets
|
|
1643
|
+
* one too, and is the live site; asking that counted no visitor of any site
|
|
1644
|
+
* that had published content without a build. The Studio's own pages count nothing
|
|
1612
1645
|
* either. Loaded with a dynamic import after hydration, so a site
|
|
1613
1646
|
* with analytics off never downloads it, and one with it on downloads it
|
|
1614
1647
|
* off the critical path. It imports nothing from core, shared or zod.
|
|
1615
1648
|
*/
|
|
1616
1649
|
React__default["default"].useEffect(function () {
|
|
1617
|
-
if (!analytics || mountOverlay !== false ||
|
|
1650
|
+
if (!analytics || mountOverlay !== false || !liveSitePage || isCanvas || isValStudioPath(location.pathname)) {
|
|
1618
1651
|
return;
|
|
1619
1652
|
}
|
|
1620
1653
|
// Where the page was hydrated, read now: the script loads later, and the
|
|
@@ -1646,7 +1679,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1646
1679
|
cancelled = true;
|
|
1647
1680
|
(_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
|
|
1648
1681
|
};
|
|
1649
|
-
}, [analytics, contentVersion, mountOverlay,
|
|
1682
|
+
}, [analytics, contentVersion, mountOverlay, liveSitePage, isCanvas, route, router]);
|
|
1650
1683
|
|
|
1651
1684
|
/**
|
|
1652
1685
|
* The leak warning, in development, for the page a visitor gets with
|
|
@@ -6,7 +6,7 @@ var asyncToGenerator = require('./asyncToGenerator-8e5c36c8.cjs.prod.js');
|
|
|
6
6
|
var _typeof = require('./typeof-8998e126.cjs.prod.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
|
-
var version = require('./version-
|
|
9
|
+
var version = require('./version-01ac69be.cjs.prod.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
11
|
var ui = require('@valbuild/ui');
|
|
12
12
|
var reactRouter = require('@tanstack/react-router');
|
|
@@ -1139,6 +1139,35 @@ function shouldSafetyRefresh(state) {
|
|
|
1139
1139
|
return true;
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
|
+
/**
|
|
1143
|
+
* What a draft page shows, read by the server for the request that renders it.
|
|
1144
|
+
*
|
|
1145
|
+
* The source of every module the editor's draft CHANGES -- the ones with
|
|
1146
|
+
* patches applied, published-not-yet-built ones included -- and nothing
|
|
1147
|
+
* else: a module without changes is the build's own source, which the page
|
|
1148
|
+
* already has. Handed to `<ValProvider draft>` so the server's render and the
|
|
1149
|
+
* browser's first render resolve the same text, and the page never shows the
|
|
1150
|
+
* published version first and the draft a moment later.
|
|
1151
|
+
*
|
|
1152
|
+
* A `.jsonValues()` module is in the shape the Studio's own store gives it: the
|
|
1153
|
+
* entries the draft edits hold their content, and every other entry is the
|
|
1154
|
+
* thunkless marker the hooks resolve from the bundle.
|
|
1155
|
+
*
|
|
1156
|
+
* Plain JSON, because it travels from a server function to the browser in the
|
|
1157
|
+
* page's loader data. `fetchValDraft` in `@valbuild/tanstack/server` reads it.
|
|
1158
|
+
*/
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Whether the page rendered from `draft` is the live site as a visitor gets
|
|
1162
|
+
* it -- what content analytics counts, and nothing else. No draft at all is,
|
|
1163
|
+
* and so is one that is only a content version's snapshot. A draft mode
|
|
1164
|
+
* render is an editor's, and a proposal's address is not the live site.
|
|
1165
|
+
*/
|
|
1166
|
+
function isLiveSitePage(draft) {
|
|
1167
|
+
if (draft === null || draft === undefined) return true;
|
|
1168
|
+
return draft.draftMode === false && draft.atProposal !== true;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1142
1171
|
/**
|
|
1143
1172
|
* Content analytics as Val's hosting sets it, for a site whose layout passes
|
|
1144
1173
|
* `<ValProvider>` no `analytics` of its own.
|
|
@@ -1429,6 +1458,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1429
1458
|
var analytics = (analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.enabled) === true;
|
|
1430
1459
|
var contentVersion = analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.contentVersion;
|
|
1431
1460
|
var snapshot = initialDraft === null || initialDraft === void 0 ? void 0 : initialDraft.snapshot;
|
|
1461
|
+
var liveSitePage = isLiveSitePage(initialDraft);
|
|
1432
1462
|
/*
|
|
1433
1463
|
* The base the Studio's overlay must start from, where it is not the
|
|
1434
1464
|
* bundle's (`ValDraft.base`): set while rendering, not in an effect, so it
|
|
@@ -1606,15 +1636,18 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1606
1636
|
* `mountOverlay === false` is "known not to be an editor": no Val enable
|
|
1607
1637
|
* cookie, so no draft mode and no canvas. A page the server rendered from a
|
|
1608
1638
|
* draft is an editor's too, whatever the enable cookie says -- the draft
|
|
1609
|
-
* mode cookie can outlive it. So is one at a proposal's address
|
|
1610
|
-
*
|
|
1611
|
-
* would credit the live site with it.
|
|
1639
|
+
* mode cookie can outlive it. So is one at a proposal's address
|
|
1640
|
+
* (`ValDraft.atProposal`): its content is not published, and counting it
|
|
1641
|
+
* would credit the live site with it. Not "one with a snapshot": a site
|
|
1642
|
+
* serving a content version -- content published without a build -- gets
|
|
1643
|
+
* one too, and is the live site; asking that counted no visitor of any site
|
|
1644
|
+
* that had published content without a build. The Studio's own pages count nothing
|
|
1612
1645
|
* either. Loaded with a dynamic import after hydration, so a site
|
|
1613
1646
|
* with analytics off never downloads it, and one with it on downloads it
|
|
1614
1647
|
* off the critical path. It imports nothing from core, shared or zod.
|
|
1615
1648
|
*/
|
|
1616
1649
|
React__default["default"].useEffect(function () {
|
|
1617
|
-
if (!analytics || mountOverlay !== false ||
|
|
1650
|
+
if (!analytics || mountOverlay !== false || !liveSitePage || isCanvas || isValStudioPath(location.pathname)) {
|
|
1618
1651
|
return;
|
|
1619
1652
|
}
|
|
1620
1653
|
// Where the page was hydrated, read now: the script loads later, and the
|
|
@@ -1646,7 +1679,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1646
1679
|
cancelled = true;
|
|
1647
1680
|
(_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
|
|
1648
1681
|
};
|
|
1649
|
-
}, [analytics, contentVersion, mountOverlay,
|
|
1682
|
+
}, [analytics, contentVersion, mountOverlay, liveSitePage, isCanvas, route, router]);
|
|
1650
1683
|
|
|
1651
1684
|
/**
|
|
1652
1685
|
* The leak warning, in development, for the page a visitor gets with
|
|
@@ -5,7 +5,7 @@ import * as core from '@valbuild/core';
|
|
|
5
5
|
export { core as expr };
|
|
6
6
|
export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
|
|
7
7
|
import { stegaEncode, stegaDecodeStrings, attrs, raw, isReactDevelopmentBuild, watchStegaLeaks, stegaLeakMessage, SET_AUTO_TAG_JSX_ENABLED, autoTagJSX } from '@valbuild/react/stega';
|
|
8
|
-
import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-
|
|
8
|
+
import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-0c586fc5.esm.js';
|
|
9
9
|
export { ValRichText } from '@valbuild/react/internal';
|
|
10
10
|
import { VERSION, VAL_APP_PATH, VAL_OVERLAY_ID, VAL_APP_ID } from '@valbuild/ui';
|
|
11
11
|
import { useRouter, useRouterState } from '@tanstack/react-router';
|
|
@@ -1115,6 +1115,35 @@ function shouldSafetyRefresh(state) {
|
|
|
1115
1115
|
return true;
|
|
1116
1116
|
}
|
|
1117
1117
|
|
|
1118
|
+
/**
|
|
1119
|
+
* What a draft page shows, read by the server for the request that renders it.
|
|
1120
|
+
*
|
|
1121
|
+
* The source of every module the editor's draft CHANGES -- the ones with
|
|
1122
|
+
* patches applied, published-not-yet-built ones included -- and nothing
|
|
1123
|
+
* else: a module without changes is the build's own source, which the page
|
|
1124
|
+
* already has. Handed to `<ValProvider draft>` so the server's render and the
|
|
1125
|
+
* browser's first render resolve the same text, and the page never shows the
|
|
1126
|
+
* published version first and the draft a moment later.
|
|
1127
|
+
*
|
|
1128
|
+
* A `.jsonValues()` module is in the shape the Studio's own store gives it: the
|
|
1129
|
+
* entries the draft edits hold their content, and every other entry is the
|
|
1130
|
+
* thunkless marker the hooks resolve from the bundle.
|
|
1131
|
+
*
|
|
1132
|
+
* Plain JSON, because it travels from a server function to the browser in the
|
|
1133
|
+
* page's loader data. `fetchValDraft` in `@valbuild/tanstack/server` reads it.
|
|
1134
|
+
*/
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Whether the page rendered from `draft` is the live site as a visitor gets
|
|
1138
|
+
* it -- what content analytics counts, and nothing else. No draft at all is,
|
|
1139
|
+
* and so is one that is only a content version's snapshot. A draft mode
|
|
1140
|
+
* render is an editor's, and a proposal's address is not the live site.
|
|
1141
|
+
*/
|
|
1142
|
+
function isLiveSitePage(draft) {
|
|
1143
|
+
if (draft === null || draft === undefined) return true;
|
|
1144
|
+
return draft.draftMode === false && draft.atProposal !== true;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1118
1147
|
/**
|
|
1119
1148
|
* Content analytics as Val's hosting sets it, for a site whose layout passes
|
|
1120
1149
|
* `<ValProvider>` no `analytics` of its own.
|
|
@@ -1405,6 +1434,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1405
1434
|
var analytics = (analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.enabled) === true;
|
|
1406
1435
|
var contentVersion = analyticsSetting === null || analyticsSetting === void 0 ? void 0 : analyticsSetting.contentVersion;
|
|
1407
1436
|
var snapshot = initialDraft === null || initialDraft === void 0 ? void 0 : initialDraft.snapshot;
|
|
1437
|
+
var liveSitePage = isLiveSitePage(initialDraft);
|
|
1408
1438
|
/*
|
|
1409
1439
|
* The base the Studio's overlay must start from, where it is not the
|
|
1410
1440
|
* bundle's (`ValDraft.base`): set while rendering, not in an effect, so it
|
|
@@ -1582,15 +1612,18 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1582
1612
|
* `mountOverlay === false` is "known not to be an editor": no Val enable
|
|
1583
1613
|
* cookie, so no draft mode and no canvas. A page the server rendered from a
|
|
1584
1614
|
* draft is an editor's too, whatever the enable cookie says -- the draft
|
|
1585
|
-
* mode cookie can outlive it. So is one at a proposal's address
|
|
1586
|
-
*
|
|
1587
|
-
* would credit the live site with it.
|
|
1615
|
+
* mode cookie can outlive it. So is one at a proposal's address
|
|
1616
|
+
* (`ValDraft.atProposal`): its content is not published, and counting it
|
|
1617
|
+
* would credit the live site with it. Not "one with a snapshot": a site
|
|
1618
|
+
* serving a content version -- content published without a build -- gets
|
|
1619
|
+
* one too, and is the live site; asking that counted no visitor of any site
|
|
1620
|
+
* that had published content without a build. The Studio's own pages count nothing
|
|
1588
1621
|
* either. Loaded with a dynamic import after hydration, so a site
|
|
1589
1622
|
* with analytics off never downloads it, and one with it on downloads it
|
|
1590
1623
|
* off the critical path. It imports nothing from core, shared or zod.
|
|
1591
1624
|
*/
|
|
1592
1625
|
React.useEffect(function () {
|
|
1593
|
-
if (!analytics || mountOverlay !== false ||
|
|
1626
|
+
if (!analytics || mountOverlay !== false || !liveSitePage || isCanvas || isValStudioPath(location.pathname)) {
|
|
1594
1627
|
return;
|
|
1595
1628
|
}
|
|
1596
1629
|
// Where the page was hydrated, read now: the script loads later, and the
|
|
@@ -1622,7 +1655,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
|
|
|
1622
1655
|
cancelled = true;
|
|
1623
1656
|
(_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
|
|
1624
1657
|
};
|
|
1625
|
-
}, [analytics, contentVersion, mountOverlay,
|
|
1658
|
+
}, [analytics, contentVersion, mountOverlay, liveSitePage, isCanvas, route, router]);
|
|
1626
1659
|
|
|
1627
1660
|
/**
|
|
1628
1661
|
* The leak warning, in development, for the page a visitor gets with
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"tanstack-router",
|
|
15
15
|
"react"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.150.
|
|
17
|
+
"version": "0.150.15",
|
|
18
18
|
"main": "dist/valbuild-tanstack.cjs.js",
|
|
19
19
|
"module": "dist/valbuild-tanstack.esm.js",
|
|
20
20
|
"exports": {
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"exports": true
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@valbuild/language-server": "0.150.14",
|
|
56
|
-
"@valbuild/mcp": "0.150.14",
|
|
57
55
|
"@valbuild/core": "0.150.3",
|
|
56
|
+
"@valbuild/language-server": "0.150.14",
|
|
58
57
|
"@valbuild/react": "0.150.14",
|
|
59
58
|
"@valbuild/server": "0.150.14",
|
|
59
|
+
"@valbuild/mcp": "0.150.14",
|
|
60
60
|
"@valbuild/shared": "0.150.13",
|
|
61
61
|
"@valbuild/ui": "0.150.14"
|
|
62
62
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-e8454128.cjs.dev.js');
|
|
6
6
|
var asyncToGenerator = require('../../dist/asyncToGenerator-c3823d62.cjs.dev.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var _typeof = require('../../dist/typeof-dd0246a1.cjs.dev.js');
|
|
@@ -762,18 +762,22 @@ function markContentApplied(http) {
|
|
|
762
762
|
* the browser, by what the editor holds -- old text first on every load.
|
|
763
763
|
*/
|
|
764
764
|
var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled, getCookies, getDraftSourcesScope, snapshot, base) {
|
|
765
|
+
var atProposal = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
765
766
|
return /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee4() {
|
|
766
|
-
var onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
767
|
+
var proposal, onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
767
768
|
return asyncToGenerator._regenerator().w(function (_context4) {
|
|
768
769
|
while (1) switch (_context4.p = _context4.n) {
|
|
769
770
|
case 0:
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
771
|
+
proposal = atProposal ? {
|
|
772
|
+
atProposal: true
|
|
773
|
+
} : {}; // At a proposal's address the page needs the snapshot whatever draft mode
|
|
774
|
+
// says, so a reviewer who is not editing sees the proposal too. So does a
|
|
775
|
+
// content version, which is the live site's content.
|
|
776
|
+
onlySnapshot = snapshot !== undefined ? _typeof._objectSpread2({
|
|
773
777
|
sources: {},
|
|
774
778
|
snapshot: snapshot,
|
|
775
779
|
draftMode: false
|
|
776
|
-
} : null;
|
|
780
|
+
}, proposal) : null;
|
|
777
781
|
_context4.p = 1;
|
|
778
782
|
_context4.n = 2;
|
|
779
783
|
return isEnabled();
|
|
@@ -848,13 +852,13 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
|
|
|
848
852
|
_context4.n = 11;
|
|
849
853
|
break;
|
|
850
854
|
case 15:
|
|
851
|
-
return _context4.a(2, _typeof._objectSpread2(_typeof._objectSpread2({
|
|
855
|
+
return _context4.a(2, _typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2({
|
|
852
856
|
sources: sources
|
|
853
857
|
}, snapshot !== undefined ? {
|
|
854
858
|
snapshot: snapshot
|
|
855
859
|
} : {}), base !== undefined ? {
|
|
856
860
|
base: base
|
|
857
|
-
} : {}));
|
|
861
|
+
} : {}), proposal));
|
|
858
862
|
case 16:
|
|
859
863
|
_context4.p = 16;
|
|
860
864
|
_t19 = _context4.v;
|
|
@@ -1621,7 +1625,7 @@ function _requestCookies() {
|
|
|
1621
1625
|
return _requestCookies.apply(this, arguments);
|
|
1622
1626
|
}
|
|
1623
1627
|
function initValContent(config, valModules, opts) {
|
|
1624
|
-
var _opts$draftMode;
|
|
1628
|
+
var _opts$draftMode, _opts$http;
|
|
1625
1629
|
var coreVersion = core.Internal.VERSION.core;
|
|
1626
1630
|
if (!coreVersion) {
|
|
1627
1631
|
throw new Error("Could not get @valbuild/core package version");
|
|
@@ -1667,7 +1671,7 @@ function initValContent(config, valModules, opts) {
|
|
|
1667
1671
|
fetchValKeyStega: initFetchValKeyStega(valServerPromise, isEnabled, requestCookies, snapshot),
|
|
1668
1672
|
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1669
1673
|
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1670
|
-
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base)
|
|
1674
|
+
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base, (opts === null || opts === void 0 || (_opts$http = opts.http) === null || _opts$http === void 0 ? void 0 : _opts$http.proposal) !== undefined)
|
|
1671
1675
|
};
|
|
1672
1676
|
}
|
|
1673
1677
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-01ac69be.cjs.prod.js');
|
|
6
6
|
var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var _typeof = require('../../dist/typeof-8998e126.cjs.prod.js');
|
|
@@ -762,18 +762,22 @@ function markContentApplied(http) {
|
|
|
762
762
|
* the browser, by what the editor holds -- old text first on every load.
|
|
763
763
|
*/
|
|
764
764
|
var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled, getCookies, getDraftSourcesScope, snapshot, base) {
|
|
765
|
+
var atProposal = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
765
766
|
return /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee4() {
|
|
766
|
-
var onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
767
|
+
var proposal, onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
767
768
|
return asyncToGenerator._regenerator().w(function (_context4) {
|
|
768
769
|
while (1) switch (_context4.p = _context4.n) {
|
|
769
770
|
case 0:
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
771
|
+
proposal = atProposal ? {
|
|
772
|
+
atProposal: true
|
|
773
|
+
} : {}; // At a proposal's address the page needs the snapshot whatever draft mode
|
|
774
|
+
// says, so a reviewer who is not editing sees the proposal too. So does a
|
|
775
|
+
// content version, which is the live site's content.
|
|
776
|
+
onlySnapshot = snapshot !== undefined ? _typeof._objectSpread2({
|
|
773
777
|
sources: {},
|
|
774
778
|
snapshot: snapshot,
|
|
775
779
|
draftMode: false
|
|
776
|
-
} : null;
|
|
780
|
+
}, proposal) : null;
|
|
777
781
|
_context4.p = 1;
|
|
778
782
|
_context4.n = 2;
|
|
779
783
|
return isEnabled();
|
|
@@ -848,13 +852,13 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
|
|
|
848
852
|
_context4.n = 11;
|
|
849
853
|
break;
|
|
850
854
|
case 15:
|
|
851
|
-
return _context4.a(2, _typeof._objectSpread2(_typeof._objectSpread2({
|
|
855
|
+
return _context4.a(2, _typeof._objectSpread2(_typeof._objectSpread2(_typeof._objectSpread2({
|
|
852
856
|
sources: sources
|
|
853
857
|
}, snapshot !== undefined ? {
|
|
854
858
|
snapshot: snapshot
|
|
855
859
|
} : {}), base !== undefined ? {
|
|
856
860
|
base: base
|
|
857
|
-
} : {}));
|
|
861
|
+
} : {}), proposal));
|
|
858
862
|
case 16:
|
|
859
863
|
_context4.p = 16;
|
|
860
864
|
_t19 = _context4.v;
|
|
@@ -1621,7 +1625,7 @@ function _requestCookies() {
|
|
|
1621
1625
|
return _requestCookies.apply(this, arguments);
|
|
1622
1626
|
}
|
|
1623
1627
|
function initValContent(config, valModules, opts) {
|
|
1624
|
-
var _opts$draftMode;
|
|
1628
|
+
var _opts$draftMode, _opts$http;
|
|
1625
1629
|
var coreVersion = core.Internal.VERSION.core;
|
|
1626
1630
|
if (!coreVersion) {
|
|
1627
1631
|
throw new Error("Could not get @valbuild/core package version");
|
|
@@ -1667,7 +1671,7 @@ function initValContent(config, valModules, opts) {
|
|
|
1667
1671
|
fetchValKeyStega: initFetchValKeyStega(valServerPromise, isEnabled, requestCookies, snapshot),
|
|
1668
1672
|
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1669
1673
|
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1670
|
-
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base)
|
|
1674
|
+
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base, (opts === null || opts === void 0 || (_opts$http = opts.http) === null || _opts$http === void 0 ? void 0 : _opts$http.proposal) !== undefined)
|
|
1671
1675
|
};
|
|
1672
1676
|
}
|
|
1673
1677
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-
|
|
1
|
+
import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-0c586fc5.esm.js';
|
|
2
2
|
import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
|
|
3
3
|
import { Internal } from '@valbuild/core';
|
|
4
4
|
import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper, g as _defineProperty, c as _typeof } from '../../dist/typeof-66e2d869.esm.js';
|
|
@@ -741,18 +741,22 @@ function markContentApplied(http) {
|
|
|
741
741
|
* the browser, by what the editor holds -- old text first on every load.
|
|
742
742
|
*/
|
|
743
743
|
var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled, getCookies, getDraftSourcesScope, snapshot, base) {
|
|
744
|
+
var atProposal = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
744
745
|
return /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
745
|
-
var onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
746
|
+
var proposal, onlySnapshot, _yield$getCookies$get, sessionCookie, modules, sources, _i, _Object$entries, _Object$entries$_i, path, module, source, _t15, _t16, _t17, _t18, _t19;
|
|
746
747
|
return _regenerator().w(function (_context4) {
|
|
747
748
|
while (1) switch (_context4.p = _context4.n) {
|
|
748
749
|
case 0:
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
proposal = atProposal ? {
|
|
751
|
+
atProposal: true
|
|
752
|
+
} : {}; // At a proposal's address the page needs the snapshot whatever draft mode
|
|
753
|
+
// says, so a reviewer who is not editing sees the proposal too. So does a
|
|
754
|
+
// content version, which is the live site's content.
|
|
755
|
+
onlySnapshot = snapshot !== undefined ? _objectSpread2({
|
|
752
756
|
sources: {},
|
|
753
757
|
snapshot: snapshot,
|
|
754
758
|
draftMode: false
|
|
755
|
-
} : null;
|
|
759
|
+
}, proposal) : null;
|
|
756
760
|
_context4.p = 1;
|
|
757
761
|
_context4.n = 2;
|
|
758
762
|
return isEnabled();
|
|
@@ -827,13 +831,13 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
|
|
|
827
831
|
_context4.n = 11;
|
|
828
832
|
break;
|
|
829
833
|
case 15:
|
|
830
|
-
return _context4.a(2, _objectSpread2(_objectSpread2({
|
|
834
|
+
return _context4.a(2, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
831
835
|
sources: sources
|
|
832
836
|
}, snapshot !== undefined ? {
|
|
833
837
|
snapshot: snapshot
|
|
834
838
|
} : {}), base !== undefined ? {
|
|
835
839
|
base: base
|
|
836
|
-
} : {}));
|
|
840
|
+
} : {}), proposal));
|
|
837
841
|
case 16:
|
|
838
842
|
_context4.p = 16;
|
|
839
843
|
_t19 = _context4.v;
|
|
@@ -1600,7 +1604,7 @@ function _requestCookies() {
|
|
|
1600
1604
|
return _requestCookies.apply(this, arguments);
|
|
1601
1605
|
}
|
|
1602
1606
|
function initValContent(config, valModules, opts) {
|
|
1603
|
-
var _opts$draftMode;
|
|
1607
|
+
var _opts$draftMode, _opts$http;
|
|
1604
1608
|
var coreVersion = Internal.VERSION.core;
|
|
1605
1609
|
if (!coreVersion) {
|
|
1606
1610
|
throw new Error("Could not get @valbuild/core package version");
|
|
@@ -1646,7 +1650,7 @@ function initValContent(config, valModules, opts) {
|
|
|
1646
1650
|
fetchValKeyStega: initFetchValKeyStega(valServerPromise, isEnabled, requestCookies, snapshot),
|
|
1647
1651
|
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1648
1652
|
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, requestHeaders, requestCookies, draftSourcesScope, snapshot),
|
|
1649
|
-
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base)
|
|
1653
|
+
fetchValDraft: initFetchValDraft(valServerPromise, isEnabled, requestCookies, draftSourcesScope, snapshot, base, (opts === null || opts === void 0 || (_opts$http = opts.http) === null || _opts$http === void 0 ? void 0 : _opts$http.proposal) !== undefined)
|
|
1650
1654
|
};
|
|
1651
1655
|
}
|
|
1652
1656
|
|