Skip to content

Commit

Permalink
✨ (History) Add chat history, syncing, and many bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
djmango committed Jun 6, 2024
1 parent 1bb7744 commit 8a03cb8
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 36 deletions.
Binary file modified Invisibility.app/Contents/CodeResources
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>8.25.2</string>
<string>8.26.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>8.25.2</string>
<string>8.26.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand All @@ -43,6 +43,6 @@
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>MinimumOSVersion</key>
<string>9999</string>
<string>100.0</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dict>
<key>Resources/Info.plist</key>
<data>
FCJ4rmjOLuIg3pw5M5oGyuD8ht8=
66dZ/F9hQffStggHIa0tkjz3lrI=
</data>
<key>Resources/PrivacyInfo.xcprivacy</key>
<data>
Expand All @@ -19,7 +19,7 @@
<dict>
<key>hash2</key>
<data>
f5jL3EP1AWE1fQGrJRdvLPRN7B9PoaGowhV84CyQqmw=
qM+UZ9sjq0FiSZZfc368AyHo7GHKRoxe9kI5uoE01wA=
</data>
</dict>
<key>Resources/PrivacyInfo.xcprivacy</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions Invisibility.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.5</string>
<string>2.2.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand All @@ -42,7 +42,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>110</string>
<string>111</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand Down
Binary file modified Invisibility.app/Contents/MacOS/Invisibility
Binary file not shown.
Binary file modified Invisibility.app/Contents/Resources/Assets.car
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(str, {language: lang}).value;
return hljs.highlight(str, { language: lang }).value;
} catch (__) { }
} else {
try {
Expand All @@ -149,6 +149,7 @@
throwOnError: false,
errorColor: '#cc0000',
},
breaks: false,
})
.use(window.markdownitSub)
.use(window.markdownitSup)
Expand All @@ -157,27 +158,48 @@

const markdownRenderedElement = document.getElementById(`markdown-rendered`);


window.updateWithMarkdownContentBase64Encoded = (markdownContentBase64Encoded) => {
const markdownContent = decodeURIComponent(atob(markdownContentBase64Encoded).split('').map(function (c) {return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);}).join(''));
const markdownContent = decodeURIComponent(atob(markdownContentBase64Encoded).split('').map(function (c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); }).join(''));
const renderedContent = markdownIt.render(markdownContent);

// Create a temporary element to hold the new rendered content
const tempElement = document.createElement('div');
tempElement.innerHTML = renderedContent;

// Clean up the temporary DOM to remove unwanted <p> tags inside <li> elements. This is what causes the numbered list line break issue.
tempElement.querySelectorAll('li > p').forEach((pTag) => {
const li = pTag.parentNode;
while (pTag.firstChild) {
li.insertBefore(pTag.firstChild, pTag);
}
pTag.remove();
});

// Use morphdom to update the content without losing the text selection
morphdom(markdownRenderedElement, tempElement, {
childrenOnly: true,
onBeforeElUpdated: function (fromEl, toEl) {
// spec - https://dom.spec.whatwg.org/#concept-node-equals
if (fromEl.isEqualNode(toEl)) {
return false
}
return true
},
childrenOnly: true,
skipFromChildren: function (fromEl, toEl) {
return true;
}
});

// // send the html contnent via POST to https://webhook.site/9251dc8e-fc67-4e37-8a72-50129affd04e for debug
// fetch('https://webhook.site/9251dc8e-fc67-4e37-8a72-50129affd04e', {
// method: 'POST',
// body: markdownRenderedElement.innerHTML
// });

window.webkit.messageHandlers.renderedContentHandler.postMessage(markdownContentBase64Encoded);
}

const resizeObserver = new ResizeObserver((entries) => {window.webkit.messageHandlers.sizeChangeHandler.postMessage(entries[0].borderBoxSize[0].blockSize)});
const resizeObserver = new ResizeObserver((entries) => { window.webkit.messageHandlers.sizeChangeHandler.postMessage(entries[0].borderBoxSize[0].blockSize) });
resizeObserver.observe(markdownRenderedElement);
</script>
</body>
Expand Down
10 changes: 5 additions & 5 deletions Invisibility.app/Contents/_CodeSignature/CodeResources
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</data>
<key>Resources/Assets.car</key>
<data>
6dExJ1RUmrBiqc00QTIzkGrIa7k=
PZVG7ojCSLq6z2haEW0I0RijSfA=
</data>
<key>Resources/KeyboardShortcuts_KeyboardShortcuts.bundle/Contents/Info.plist</key>
<data>
Expand Down Expand Up @@ -205,7 +205,7 @@
</data>
<key>Resources/markdown-webview_MarkdownWebView.bundle/Contents/Resources/template</key>
<data>
fveEfR2NtvXZ992H+qftWxWYbDo=
BMvEiDga03j2uIfy4uyXHdB4ZTs=
</data>
<key>Resources/screenshot.mp4</key>
<data>
Expand All @@ -222,7 +222,7 @@
<dict>
<key>cdhash</key>
<data>
H9n68fcJ9KrGgqSEGBl6WBWWS80=
oBezF1Fx7FCsi/fKHfv/OQKTjVc=
</data>
<key>requirement</key>
<string>anchor apple generic and identifier "io.sentry.Sentry" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = U854WW4U2R)</string>
Expand Down Expand Up @@ -261,7 +261,7 @@
<dict>
<key>hash2</key>
<data>
53DPwAUDMu2HwfnxHU38q9ynW/DQOCo8rEyjf6RKdXw=
0aZ3xsDkKLUjAtZGCnx6/OYYtomIR3J2ldmbqryui1U=
</data>
</dict>
<key>Resources/KeyboardShortcuts_KeyboardShortcuts.bundle/Contents/Info.plist</key>
Expand Down Expand Up @@ -487,7 +487,7 @@
<dict>
<key>hash2</key>
<data>
NPvhibHLyXioMHRJqdrtB7ZyrIV5NXFvAlRqB7xdF3g=
Fmkp8M1hadxAOTd//eRL3dJGawf91RuqyPELHTxF5PU=
</data>
</dict>
<key>Resources/screenshot.mp4</key>
Expand Down
29 changes: 10 additions & 19 deletions appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,29 @@
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Invisibility</title>
<item>
<title>2.2.0</title>
<pubDate>Thu, 06 Jun 2024 01:45:15 -0700</pubDate>
<sparkle:version>111</sparkle:version>
<sparkle:shortVersionString>2.2.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>14.0</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.2.0/Invisibility.Installer.dmg" length="17024689" type="application/octet-stream" sparkle:edSignature="eiCtzXDXXHJqBHLh1SlvZEaf/xnXBMtikT6xC9aGmcFxrI7w3uSS6txDvnyDobxRB2Xw18X2vJvH/g0TyNM5BA=="/>
</item>
<item>
<title>2.1.5</title>
<pubDate>Thu, 16 May 2024 00:06:38 -0700</pubDate>
<sparkle:version>110</sparkle:version>
<sparkle:shortVersionString>2.1.5</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>14.0</sparkle:minimumSystemVersion>
<enclosure
url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.1.5/Invisibility.Installer.dmg"
length="16931057" type="application/octet-stream"
sparkle:edSignature="3v/0epVyWgbhkMrXPLxu0psg4j3mAe8wjnECaJhy3oOBlpd3abxQ6FfFAlSLllMSDG7iiGpQZ9EzrxouboopCQ==" />
<enclosure url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.1.5/Invisibility.Installer.dmg" length="16931057" type="application/octet-stream" sparkle:edSignature="3v/0epVyWgbhkMrXPLxu0psg4j3mAe8wjnECaJhy3oOBlpd3abxQ6FfFAlSLllMSDG7iiGpQZ9EzrxouboopCQ=="/>
</item>
<item>
<title>2.1.4</title>
<pubDate>Wed, 15 May 2024 20:24:26 -0700</pubDate>
<sparkle:version>109</sparkle:version>
<sparkle:shortVersionString>2.1.4</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>14.0</sparkle:minimumSystemVersion>
<enclosure
url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.1.4/Invisibility.Installer.dmg"
length="16915647" type="application/octet-stream"
sparkle:edSignature="kVU2j2Z4H8YAUUnGu3GIKdf+U4VKcp/Mup4JiqHLwae5MCrSAFvUkUGIYCUj2G3TmaPr3QziMWQGxzQSjbsmDg==" />
</item>
<item>
<title>2.1.3</title>
<pubDate>Wed, 15 May 2024 20:06:59 -0700</pubDate>
<sparkle:version>108</sparkle:version>
<sparkle:shortVersionString>2.1.3</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>14.0</sparkle:minimumSystemVersion>
<enclosure
url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.1.3/Invisibility.Installer.dmg"
length="16918196" type="application/octet-stream"
sparkle:edSignature="5BWtwOBjJAlr/2BN8zQ9kHUJAmDhC10h+s62x5aH4MiagWpsfUG1qQpgdVldVGHT3fRogLzb1JXDbjLiuiw0BA==" />
<enclosure url="https://github.com/InvisibilityInc/Invisibility/releases/download/2.1.4/Invisibility.Installer.dmg" length="16915647" type="application/octet-stream" sparkle:edSignature="kVU2j2Z4H8YAUUnGu3GIKdf+U4VKcp/Mup4JiqHLwae5MCrSAFvUkUGIYCUj2G3TmaPr3QziMWQGxzQSjbsmDg=="/>
</item>
</channel>
</rss>

0 comments on commit 8a03cb8

Please sign in to comment.