@contentstorage/core 0.3.41 → 0.3.42
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.
|
@@ -78,6 +78,7 @@ export function getText(contentKey, variables) {
|
|
|
78
78
|
idSet.add(contentKey); // Add the current ID to the set.
|
|
79
79
|
window.memoryMap.set(key, {
|
|
80
80
|
ids: idSet,
|
|
81
|
+
type: 'text',
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
if (!variables || Object.keys(variables).length === 0) {
|
|
@@ -126,9 +127,20 @@ export function getImage(contentKey) {
|
|
|
126
127
|
typeof current === 'object' &&
|
|
127
128
|
current.contentstorage_type === 'image' &&
|
|
128
129
|
typeof current.url === 'string') {
|
|
130
|
+
const currentData = current;
|
|
131
|
+
if (window.parent && window.parent !== window) {
|
|
132
|
+
const key = currentData.url;
|
|
133
|
+
const existingEntry = window.memoryMap.get(key);
|
|
134
|
+
const idSet = existingEntry ? existingEntry.ids : new Set();
|
|
135
|
+
idSet.add(contentKey); // Add the current ID to the set.
|
|
136
|
+
window.memoryMap.set(key, {
|
|
137
|
+
ids: idSet,
|
|
138
|
+
type: 'image',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
129
141
|
return {
|
|
130
142
|
contentKey,
|
|
131
|
-
data:
|
|
143
|
+
data: currentData,
|
|
132
144
|
};
|
|
133
145
|
}
|
|
134
146
|
else {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@contentstorage/core",
|
|
3
3
|
"author": "Kaido Hussar <kaidohus@gmail.com>",
|
|
4
4
|
"homepage": "https://contentstorage.app",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.42",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Fetch content from contentstorage and generate TypeScript types",
|
|
8
8
|
"module": "dist/index.js",
|