get-notion-contents
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -49,3 +49,5 @@ declare type Role = 'editor' | 'reader' | string; | ||
export declare type NotionContent = { | ||
id: string; | ||
title: string; | ||
titleString: string; | ||
content: string; | ||
@@ -52,0 +54,0 @@ resource?: string; |
@@ -28,3 +28,3 @@ "use strict"; | ||
const data = yield page.evaluate(() => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
const contentEditable$ = document.querySelectorAll('div[contenteditable=true]'); | ||
@@ -74,12 +74,15 @@ (_a = contentEditable$) === null || _a === void 0 ? void 0 : _a.forEach((item) => { | ||
const title$ = content$.parentElement.querySelector('div > div'); | ||
const title = (_c = (_b = title$) === null || _b === void 0 ? void 0 : _b.innerHTML, (_c !== null && _c !== void 0 ? _c : '')); | ||
const titleString = (_c = (_b = title$) === null || _b === void 0 ? void 0 : _b.textContent, (_c !== null && _c !== void 0 ? _c : '')); | ||
const title = (_e = (_d = title$) === null || _d === void 0 ? void 0 : _d.innerHTML, (_e !== null && _e !== void 0 ? _e : '')); | ||
const content = content$.innerHTML; | ||
return { | ||
id: pageId, | ||
title, | ||
titleString, | ||
content, | ||
}; | ||
} | ||
const view$ = (_d = document | ||
const view$ = (_f = document | ||
.getElementById('notion-app') | ||
.querySelectorAll('.notion-board-view, .notion-list-view, .notion-table-view, .notion-gallery-view')) === null || _d === void 0 ? void 0 : _d[0]; | ||
.querySelectorAll('.notion-board-view, .notion-list-view, .notion-table-view, .notion-gallery-view')) === null || _f === void 0 ? void 0 : _f[0]; | ||
if (view$ == null) { | ||
@@ -89,9 +92,12 @@ return null; | ||
{ | ||
const title$ = (_e = view$.parentElement.parentElement.querySelector('div[placeholder="Untitled"]')) === null || _e === void 0 ? void 0 : _e.parentElement.parentElement; | ||
const title$ = (_g = view$.parentElement.parentElement.querySelector('div[placeholder="Untitled"]')) === null || _g === void 0 ? void 0 : _g.parentElement.parentElement; | ||
const content$ = title$.nextElementSibling; | ||
const title = (_g = (_f = title$) === null || _f === void 0 ? void 0 : _f.innerHTML, (_g !== null && _g !== void 0 ? _g : '')); | ||
const content = (_j = (_h = content$) === null || _h === void 0 ? void 0 : _h.innerHTML, (_j !== null && _j !== void 0 ? _j : '')); | ||
const titleString = (_j = (_h = title$) === null || _h === void 0 ? void 0 : _h.textContent, (_j !== null && _j !== void 0 ? _j : '')); | ||
const title = (_l = (_k = title$) === null || _k === void 0 ? void 0 : _k.innerHTML, (_l !== null && _l !== void 0 ? _l : '')); | ||
const content = (_o = (_m = content$) === null || _m === void 0 ? void 0 : _m.innerHTML, (_o !== null && _o !== void 0 ? _o : '')); | ||
const resource = view$.innerHTML; | ||
return { | ||
id: pageId, | ||
title, | ||
titleString, | ||
content, | ||
@@ -98,0 +104,0 @@ resource, |
{ | ||
"name": "get-notion-contents", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Get contents from notion", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -46,3 +46,5 @@ # get-notion-contents | ||
Promise<{ | ||
id: string; | ||
title: string; | ||
titleString: string; | ||
content: string; | ||
@@ -56,3 +58,5 @@ resource?: string; | ||
Promise<Array<{ | ||
id: string; | ||
title: string; | ||
titleString: string; | ||
content: string; | ||
@@ -59,0 +63,0 @@ resource?: string; |
17343
342
98