mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
added a protocol for hoarders
This commit is contained in:
@@ -77,6 +77,8 @@
|
|||||||
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
||||||
A9BE30FB2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
A9BE30FB2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
||||||
A9BE30FC2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
A9BE30FC2F5B03F400A57668 /* Sticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30F92F5B03F400A57668 /* Sticker.swift */; };
|
||||||
|
A9BE30FE2F5FA47100A57668 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
|
||||||
|
A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE30FD2F5FA47100A57668 /* Hoarder.swift */; };
|
||||||
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
A9C172DC2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
||||||
A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
A9C172DD2EB8C9AC008A7885 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C172DB2EB8C9AC008A7885 /* Trie.swift */; };
|
||||||
A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
|
A9CD6C352EDDE22800B7F421 /* EmojiPackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */; };
|
||||||
@@ -168,6 +170,7 @@
|
|||||||
A9BE30F12F5B004E00A57668 /* Gif.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gif.swift; sourceTree = "<group>"; };
|
A9BE30F12F5B004E00A57668 /* Gif.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gif.swift; sourceTree = "<group>"; };
|
||||||
A9BE30F52F5B011A00A57668 /* StickerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerProtocol.swift; sourceTree = "<group>"; };
|
A9BE30F52F5B011A00A57668 /* StickerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerProtocol.swift; sourceTree = "<group>"; };
|
||||||
A9BE30F92F5B03F400A57668 /* Sticker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sticker.swift; sourceTree = "<group>"; };
|
A9BE30F92F5B03F400A57668 /* Sticker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sticker.swift; sourceTree = "<group>"; };
|
||||||
|
A9BE30FD2F5FA47100A57668 /* Hoarder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Hoarder.swift; sourceTree = "<group>"; };
|
||||||
A9C172DB2EB8C9AC008A7885 /* Trie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trie.swift; sourceTree = "<group>"; };
|
A9C172DB2EB8C9AC008A7885 /* Trie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Trie.swift; sourceTree = "<group>"; };
|
||||||
A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackView.swift; sourceTree = "<group>"; };
|
A9CD6C342EDDE22800B7F421 /* EmojiPackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackView.swift; sourceTree = "<group>"; };
|
||||||
A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackManager.swift; sourceTree = "<group>"; };
|
A9CD6C372EDDE37500B7F421 /* EmojiPackManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPackManager.swift; sourceTree = "<group>"; };
|
||||||
@@ -324,6 +327,7 @@
|
|||||||
A9104C812EB4022E00D160EA /* Extensions */,
|
A9104C812EB4022E00D160EA /* Extensions */,
|
||||||
A91C098E2EBBD7C700210C34 /* UIKit */,
|
A91C098E2EBBD7C700210C34 /* UIKit */,
|
||||||
A91C098D2EBBD7C100210C34 /* SwiftUI */,
|
A91C098D2EBBD7C100210C34 /* SwiftUI */,
|
||||||
|
A9BE30FD2F5FA47100A57668 /* Hoarder.swift */,
|
||||||
);
|
);
|
||||||
path = StickerSlack;
|
path = StickerSlack;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -571,6 +575,7 @@
|
|||||||
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */,
|
A9BE30F02F5B004800A57668 /* GifHoarder.swift in Sources */,
|
||||||
A9BE30F22F5B004E00A57668 /* Gif.swift in Sources */,
|
A9BE30F22F5B004E00A57668 /* Gif.swift in Sources */,
|
||||||
A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */,
|
A9BE30EC2F5AFE1E00A57668 /* StickerType.swift in Sources */,
|
||||||
|
A9BE30FE2F5FA47100A57668 /* Hoarder.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -585,6 +590,7 @@
|
|||||||
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */,
|
A9EB724B2EB94A5700658CEB /* Trie.swift in Sources */,
|
||||||
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */,
|
A9BE30FA2F5B03F400A57668 /* Sticker.swift in Sources */,
|
||||||
A986A6CD2EB659E000B6E0FA /* MessagesViewController.swift in Sources */,
|
A986A6CD2EB659E000B6E0FA /* MessagesViewController.swift in Sources */,
|
||||||
|
A9BE30FF2F5FA78E00A57668 /* Hoarder.swift in Sources */,
|
||||||
A986A6CE2EB659E000B6E0FA /* StickerBrowserDataSource.swift in Sources */,
|
A986A6CE2EB659E000B6E0FA /* StickerBrowserDataSource.swift in Sources */,
|
||||||
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
|
A957C17E2ECFAA1100EA3EE9 /* GifView.swift in Sources */,
|
||||||
A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
|
A9BBC5192EB8FA4500FFE82F /* ViewModifiers.swift in Sources */,
|
||||||
|
|||||||
@@ -11,14 +11,11 @@ import Combine
|
|||||||
import UniformTypeIdentifiers
|
import UniformTypeIdentifiers
|
||||||
import Haptics
|
import Haptics
|
||||||
|
|
||||||
class EmojiHoarder: ObservableObject {
|
class EmojiHoarder: Hoarder, ObservableObject {
|
||||||
static let container = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
|
||||||
nonisolated static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
|
nonisolated static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
|
||||||
nonisolated static let localTrie: URL = EmojiHoarder.container.appendingPathComponent("_localTrie.json", conformingTo: .fileURL)
|
nonisolated static let localTrie: URL = EmojiHoarder.container.appendingPathComponent("_localTrie.json", conformingTo: .fileURL)
|
||||||
nonisolated static let localTrieDict: URL = EmojiHoarder.container.appendingPathComponent("_localTrieDict.json", conformingTo: .fileURL)
|
nonisolated static let localTrieDict: URL = EmojiHoarder.container.appendingPathComponent("_localTrieDict.json", conformingTo: .fileURL)
|
||||||
private let endpoint: URL = URL(string: "https://cachet.dunkirk.sh/emojis")!
|
let endpoint: URL = URL(string: "https://cachet.dunkirk.sh/emojis")!
|
||||||
private let encoder = JSONEncoder()
|
|
||||||
private let decoder = JSONDecoder()
|
|
||||||
|
|
||||||
@Published var emojis: [Emoji] = []
|
@Published var emojis: [Emoji] = []
|
||||||
@Published var emojiPacks: [EmojiPack] = []
|
@Published var emojiPacks: [EmojiPack] = []
|
||||||
|
|||||||
@@ -6,3 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import SwiftUI
|
||||||
|
import Combine
|
||||||
|
|
||||||
|
//class GifHoarder: Hoarder {
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
|||||||
27
StickerSlack/Hoarder.swift
Normal file
27
StickerSlack/Hoarder.swift
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// Hoarder.swift
|
||||||
|
// StickerSlack
|
||||||
|
//
|
||||||
|
// Created by neon443 on 10/03/2026.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import SwiftUI
|
||||||
|
import Combine
|
||||||
|
import UniformTypeIdentifiers
|
||||||
|
|
||||||
|
protocol Hoarder {
|
||||||
|
static var container: URL { get }
|
||||||
|
var endpoint: URL { get }
|
||||||
|
var encoder: JSONEncoder { get }
|
||||||
|
var decoder: JSONDecoder { get }
|
||||||
|
var searchTerm: String { get set }
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Hoarder {
|
||||||
|
static var container: URL { FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||||
|
}
|
||||||
|
|
||||||
|
var encoder: JSONEncoder { JSONEncoder() }
|
||||||
|
var decoder: JSONDecoder { JSONDecoder() }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user