@plasmicpkgs/plasmic-cms 0.0.99 → 0.0.102
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/dist/plasmic-cms.cjs.development.js +10 -10
- package/dist/plasmic-cms.cjs.development.js.map +1 -1
- package/dist/plasmic-cms.cjs.production.min.js +1 -1
- package/dist/plasmic-cms.cjs.production.min.js.map +1 -1
- package/dist/plasmic-cms.esm.js +10 -10
- package/dist/plasmic-cms.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/plasmic-cms.esm.js
CHANGED
|
@@ -1103,19 +1103,19 @@ function mkApi(config) {
|
|
|
1103
1103
|
return new API(config);
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
|
-
var contextPrefix = "
|
|
1107
|
-
var databaseContextKey = contextPrefix + "
|
|
1108
|
-
var tablesContextKey = contextPrefix + "
|
|
1109
|
-
var
|
|
1106
|
+
var contextPrefix = "plasmicCms";
|
|
1107
|
+
var databaseContextKey = contextPrefix + "Database";
|
|
1108
|
+
var tablesContextKey = contextPrefix + "Tables";
|
|
1109
|
+
var collectionResultSuffix = "Collection";
|
|
1110
1110
|
|
|
1111
1111
|
var mkQueryContextKey = function mkQueryContextKey(table) {
|
|
1112
|
-
return "" +
|
|
1112
|
+
return "" + contextPrefix + table + collectionResultSuffix;
|
|
1113
1113
|
};
|
|
1114
1114
|
|
|
1115
|
-
var
|
|
1115
|
+
var itemContextSuffix = "Item";
|
|
1116
1116
|
|
|
1117
1117
|
var mkRowContextKey = function mkRowContextKey(table) {
|
|
1118
|
-
return "" +
|
|
1118
|
+
return "" + contextPrefix + table + itemContextSuffix;
|
|
1119
1119
|
};
|
|
1120
1120
|
|
|
1121
1121
|
function useDatabase() {
|
|
@@ -1141,9 +1141,9 @@ function TablesProvider(_ref2) {
|
|
|
1141
1141
|
}, children);
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
|
-
function getClosestMatchingKeys(env,
|
|
1144
|
+
function getClosestMatchingKeys(env, suffix) {
|
|
1145
1145
|
return [].concat(Object.keys(env).reverse()).filter(function (k) {
|
|
1146
|
-
return k.
|
|
1146
|
+
return k.endsWith(suffix);
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
@@ -1168,7 +1168,7 @@ function useTablesWithDataLoaded() {
|
|
|
1168
1168
|
return undefined;
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
-
var matchingKeys = getClosestMatchingKeys(env,
|
|
1171
|
+
var matchingKeys = getClosestMatchingKeys(env, itemContextSuffix);
|
|
1172
1172
|
return tables.filter(function (table) {
|
|
1173
1173
|
return matchingKeys.some(function (key) {
|
|
1174
1174
|
return mkRowContextKey(table.identifier) === key;
|