@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.
@@ -1103,19 +1103,19 @@ function mkApi(config) {
1103
1103
  return new API(config);
1104
1104
  }
1105
1105
 
1106
- var contextPrefix = "__plasmic_cms";
1107
- var databaseContextKey = contextPrefix + "_database";
1108
- var tablesContextKey = contextPrefix + "_tables";
1109
- var queryResultPrefix = contextPrefix + "_query_";
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 "" + queryResultPrefix + table;
1112
+ return "" + contextPrefix + table + collectionResultSuffix;
1113
1113
  };
1114
1114
 
1115
- var rowContextPrefix = contextPrefix + "_row_";
1115
+ var itemContextSuffix = "Item";
1116
1116
 
1117
1117
  var mkRowContextKey = function mkRowContextKey(table) {
1118
- return "" + rowContextPrefix + table;
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, prefix) {
1144
+ function getClosestMatchingKeys(env, suffix) {
1145
1145
  return [].concat(Object.keys(env).reverse()).filter(function (k) {
1146
- return k.startsWith(prefix);
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, rowContextPrefix);
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;