@plasmicpkgs/plasmic-cms 0.0.97 → 0.0.100

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.
@@ -1110,19 +1110,19 @@ function mkApi(config) {
1110
1110
  return new API(config);
1111
1111
  }
1112
1112
 
1113
- var contextPrefix = "__plasmic_cms";
1114
- var databaseContextKey = contextPrefix + "_database";
1115
- var tablesContextKey = contextPrefix + "_tables";
1116
- var queryResultPrefix = contextPrefix + "_query_";
1113
+ var contextPrefix = "plasmicCms";
1114
+ var databaseContextKey = contextPrefix + "Database";
1115
+ var tablesContextKey = contextPrefix + "Tables";
1116
+ var collectionResultSuffix = "Collection";
1117
1117
 
1118
1118
  var mkQueryContextKey = function mkQueryContextKey(table) {
1119
- return "" + queryResultPrefix + table;
1119
+ return "" + contextPrefix + table + collectionResultSuffix;
1120
1120
  };
1121
1121
 
1122
- var rowContextPrefix = contextPrefix + "_row_";
1122
+ var itemContextSuffix = "Item";
1123
1123
 
1124
1124
  var mkRowContextKey = function mkRowContextKey(table) {
1125
- return "" + rowContextPrefix + table;
1125
+ return "" + contextPrefix + table + itemContextSuffix;
1126
1126
  };
1127
1127
 
1128
1128
  function useDatabase() {
@@ -1148,9 +1148,9 @@ function TablesProvider(_ref2) {
1148
1148
  }, children);
1149
1149
  }
1150
1150
 
1151
- function getClosestMatchingKeys(env, prefix) {
1151
+ function getClosestMatchingKeys(env, suffix) {
1152
1152
  return [].concat(Object.keys(env).reverse()).filter(function (k) {
1153
- return k.startsWith(prefix);
1153
+ return k.endsWith(suffix);
1154
1154
  });
1155
1155
  }
1156
1156
 
@@ -1175,7 +1175,7 @@ function useTablesWithDataLoaded() {
1175
1175
  return undefined;
1176
1176
  }
1177
1177
 
1178
- var matchingKeys = getClosestMatchingKeys(env, rowContextPrefix);
1178
+ var matchingKeys = getClosestMatchingKeys(env, itemContextSuffix);
1179
1179
  return tables.filter(function (table) {
1180
1180
  return matchingKeys.some(function (key) {
1181
1181
  return mkRowContextKey(table.identifier) === key;