mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
chore: fix some typos (#14334)
This commit is contained in:
@@ -57,7 +57,7 @@ function checkChangeFiles(changeFiles) {
|
|||||||
for (const [file, packages] of unknownTagsEntries) {
|
for (const [file, packages] of unknownTagsEntries) {
|
||||||
for (const { package, tag } of packages) {
|
for (const { package, tag } of packages) {
|
||||||
console.error(
|
console.error(
|
||||||
`Package \`${package}\` has an uknown change tag ${tag} in ${file} `
|
`Package \`${package}\` has an unknown change tag ${tag} in ${file} `
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const ignore = [
|
|||||||
async function checkFile(file) {
|
async function checkFile(file) {
|
||||||
if (
|
if (
|
||||||
extensions.some((e) => file.endsWith(e))
|
extensions.some((e) => file.endsWith(e))
|
||||||
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) == i)
|
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) === i)
|
||||||
) {
|
) {
|
||||||
const fileStream = fs.createReadStream(file)
|
const fileStream = fs.createReadStream(file)
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
|
|||||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -8536,7 +8536,6 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
"tray-icon",
|
"tray-icon",
|
||||||
"url",
|
"url",
|
||||||
"urlpattern",
|
|
||||||
"uuid",
|
"uuid",
|
||||||
"webkit2gtk",
|
"webkit2gtk",
|
||||||
"webview2-com",
|
"webview2-com",
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ fn read_plugins_manifests() -> Result<BTreeMap<String, Manifest>> {
|
|||||||
Ok(manifests)
|
Ok(manifests)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InlinedPuginsAcl {
|
struct InlinedPluginsAcl {
|
||||||
manifests: BTreeMap<String, Manifest>,
|
manifests: BTreeMap<String, Manifest>,
|
||||||
permission_files: BTreeMap<String, Vec<PermissionFile>>,
|
permission_files: BTreeMap<String, Vec<PermissionFile>>,
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ struct InlinedPuginsAcl {
|
|||||||
fn inline_plugins(
|
fn inline_plugins(
|
||||||
out_dir: &Path,
|
out_dir: &Path,
|
||||||
inlined_plugins: HashMap<&'static str, InlinedPlugin>,
|
inlined_plugins: HashMap<&'static str, InlinedPlugin>,
|
||||||
) -> Result<InlinedPuginsAcl> {
|
) -> Result<InlinedPluginsAcl> {
|
||||||
let mut acl_manifests = BTreeMap::new();
|
let mut acl_manifests = BTreeMap::new();
|
||||||
let mut permission_files_map = BTreeMap::new();
|
let mut permission_files_map = BTreeMap::new();
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ permissions = [{default_permissions}]
|
|||||||
acl_manifests.insert(name.into(), manifest);
|
acl_manifests.insert(name.into(), manifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(InlinedPuginsAcl {
|
Ok(InlinedPluginsAcl {
|
||||||
manifests: acl_manifests,
|
manifests: acl_manifests,
|
||||||
permission_files: permission_files_map,
|
permission_files: permission_files_map,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ impl WindowsAttributes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates the default attriute set wihtou the default app manifest.
|
/// Creates the default attribute set without the default app manifest.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new_without_app_manifest() -> Self {
|
pub fn new_without_app_manifest() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -921,7 +921,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Mica effect that matches the system dark perefence **Windows 11 Only**",
|
"description": "Mica effect that matches the system dark preference **Windows 11 Only**",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"mica"
|
"mica"
|
||||||
@@ -942,7 +942,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Tabbed effect that matches the system dark perefence **Windows 11 Only**",
|
"description": "Tabbed effect that matches the system dark preference **Windows 11 Only**",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"tabbed"
|
"tabbed"
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ fn migrate_config(config: &mut Value) -> Result<MigratedConfig> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dangerousUseHttpScheme/useHttpsScheme
|
// dangerousUseHttpScheme/useHttpsScheme
|
||||||
let dangerouse_use_http = tauri_config
|
let dangerous_use_http = tauri_config
|
||||||
.get("security")
|
.get("security")
|
||||||
.and_then(|w| w.as_object())
|
.and_then(|w| w.as_object())
|
||||||
.and_then(|w| {
|
.and_then(|w| {
|
||||||
@@ -120,7 +120,7 @@ fn migrate_config(config: &mut Value) -> Result<MigratedConfig> {
|
|||||||
{
|
{
|
||||||
for window in windows {
|
for window in windows {
|
||||||
if let Some(window) = window.as_object_mut() {
|
if let Some(window) = window.as_object_mut() {
|
||||||
window.insert("useHttpsScheme".to_string(), (!dangerouse_use_http).into());
|
window.insert("useHttpsScheme".to_string(), (!dangerous_use_http).into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -812,7 +812,7 @@ impl WindowBuilder for WindowBuilderWrapper {
|
|||||||
{
|
{
|
||||||
// TODO: find a proper way to prevent webview being pushed out of the window.
|
// TODO: find a proper way to prevent webview being pushed out of the window.
|
||||||
// Workround for issue: https://github.com/tauri-apps/tauri/issues/10225
|
// Workround for issue: https://github.com/tauri-apps/tauri/issues/10225
|
||||||
// The window requies `NSFullSizeContentViewWindowMask` flag to prevent devtools
|
// The window requires `NSFullSizeContentViewWindowMask` flag to prevent devtools
|
||||||
// pushing the content view out of the window.
|
// pushing the content view out of the window.
|
||||||
// By setting the default style to `TitleBarStyle::Visible` should fix the issue for most of the users.
|
// By setting the default style to `TitleBarStyle::Visible` should fix the issue for most of the users.
|
||||||
builder = builder.title_bar_style(TitleBarStyle::Visible);
|
builder = builder.title_bar_style(TitleBarStyle::Visible);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ pub trait WindowExt {
|
|||||||
/// - **Android / iOS**: Unsupported.
|
/// - **Android / iOS**: Unsupported.
|
||||||
fn center(&self) {}
|
fn center(&self) {}
|
||||||
|
|
||||||
/// Clears the window sufrace. i.e make it it transparent.
|
/// Clears the window surface. i.e make it it transparent.
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn draw_surface(
|
fn draw_surface(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -921,7 +921,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Mica effect that matches the system dark perefence **Windows 11 Only**",
|
"description": "Mica effect that matches the system dark preference **Windows 11 Only**",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"mica"
|
"mica"
|
||||||
@@ -942,7 +942,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Tabbed effect that matches the system dark perefence **Windows 11 Only**",
|
"description": "Tabbed effect that matches the system dark preference **Windows 11 Only**",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"tabbed"
|
"tabbed"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ pub const PERMISSION_SCHEMA_FILE_NAME: &str = "schema.json";
|
|||||||
pub const APP_ACL_KEY: &str = "__app-acl__";
|
pub const APP_ACL_KEY: &str = "__app-acl__";
|
||||||
/// Known acl manifests file
|
/// Known acl manifests file
|
||||||
pub const ACL_MANIFESTS_FILE_NAME: &str = "acl-manifests.json";
|
pub const ACL_MANIFESTS_FILE_NAME: &str = "acl-manifests.json";
|
||||||
/// Known capabilityies file
|
/// Known capabilities file
|
||||||
pub const CAPABILITIES_FILE_NAME: &str = "capabilities.json";
|
pub const CAPABILITIES_FILE_NAME: &str = "capabilities.json";
|
||||||
/// Allowed commands file name
|
/// Allowed commands file name
|
||||||
pub const ALLOWED_COMMANDS_FILE_NAME: &str = "allowed-commands.json";
|
pub const ALLOWED_COMMANDS_FILE_NAME: &str = "allowed-commands.json";
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ impl<'a> PermissionSchemaGenerator<'a, Iter<'a, PermissionSet>, Iter<'a, Permiss
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collect and include all possible identifiers in `Identifier` defintion in the schema
|
/// Collect and include all possible identifiers in `Identifier` definition in the schema
|
||||||
fn extend_identifier_schema(schema: &mut RootSchema, acl: &BTreeMap<String, Manifest>) {
|
fn extend_identifier_schema(schema: &mut RootSchema, acl: &BTreeMap<String, Manifest>) {
|
||||||
if let Some(Schema::Object(identifier_schema)) = schema.definitions.get_mut("Identifier") {
|
if let Some(Schema::Object(identifier_schema)) = schema.definitions.get_mut("Identifier") {
|
||||||
let permission_schemas = acl
|
let permission_schemas = acl
|
||||||
@@ -214,9 +214,9 @@ fn extend_identifier_schema(schema: &mut RootSchema, acl: &BTreeMap<String, Mani
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collect permission schemas and its associated scope schema and schema definitons from plugins
|
/// Collect permission schemas and its associated scope schema and schema definitions from plugins
|
||||||
/// and replace `PermissionEntry` extend object syntax with a new schema that does conditional
|
/// and replace `PermissionEntry` extend object syntax with a new schema that does conditional
|
||||||
/// checks to serve the relavent scope schema for the right permissions schema, in a nutshell, it
|
/// checks to serve the relevant scope schema for the right permissions schema, in a nutshell, it
|
||||||
/// will look something like this:
|
/// will look something like this:
|
||||||
/// ```text
|
/// ```text
|
||||||
/// PermissionEntry {
|
/// PermissionEntry {
|
||||||
@@ -250,16 +250,16 @@ fn extend_permission_entry_schema(root_schema: &mut RootSchema, acl: &BTreeMap<S
|
|||||||
|
|
||||||
if let Some(Schema::Object(obj)) = root_schema.definitions.get_mut("PermissionEntry") {
|
if let Some(Schema::Object(obj)) = root_schema.definitions.get_mut("PermissionEntry") {
|
||||||
let any_of = obj.subschemas().any_of.as_mut().unwrap();
|
let any_of = obj.subschemas().any_of.as_mut().unwrap();
|
||||||
let Schema::Object(extened_permission_entry) = any_of.last_mut().unwrap() else {
|
let Schema::Object(extend_permission_entry) = any_of.last_mut().unwrap() else {
|
||||||
unreachable!("PermissionsEntry should be an object not a boolean");
|
unreachable!("PermissionsEntry should be an object not a boolean");
|
||||||
};
|
};
|
||||||
|
|
||||||
// remove default properties and save it to be added later as a fallback
|
// remove default properties and save it to be added later as a fallback
|
||||||
let obj = extened_permission_entry.object.as_mut().unwrap();
|
let obj = extend_permission_entry.object.as_mut().unwrap();
|
||||||
let default_properties = std::mem::take(&mut obj.properties);
|
let default_properties = std::mem::take(&mut obj.properties);
|
||||||
|
|
||||||
let defaut_identifier = default_properties.get(IDENTIFIER).cloned().unwrap();
|
let default_identifier = default_properties.get(IDENTIFIER).cloned().unwrap();
|
||||||
let default_identifier = (IDENTIFIER.to_string(), defaut_identifier);
|
let default_identifier = (IDENTIFIER.to_string(), default_identifier);
|
||||||
|
|
||||||
let mut all_of = vec![];
|
let mut all_of = vec![];
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ fn extend_permission_entry_schema(root_schema: &mut RootSchema, acl: &BTreeMap<S
|
|||||||
all_of.push(Schema::Object(default_obj));
|
all_of.push(Schema::Object(default_obj));
|
||||||
|
|
||||||
// replace extended PermissionEntry with the new schema
|
// replace extended PermissionEntry with the new schema
|
||||||
extened_permission_entry.subschemas().all_of = Some(all_of);
|
extend_permission_entry.subschemas().all_of = Some(all_of);
|
||||||
}
|
}
|
||||||
|
|
||||||
// extend root schema with definitions collected from plugins
|
// extend root schema with definitions collected from plugins
|
||||||
@@ -352,7 +352,7 @@ fn extend_permission_file_schema(schema: &mut RootSchema, permissions: &[Permiss
|
|||||||
let permissions_obj = obj.object().properties.get_mut("permissions");
|
let permissions_obj = obj.object().properties.get_mut("permissions");
|
||||||
if let Some(Schema::Object(permissions_obj)) = permissions_obj {
|
if let Some(Schema::Object(permissions_obj)) = permissions_obj {
|
||||||
// replace the permissions property schema object
|
// replace the permissions property schema object
|
||||||
// from a mere string to a referecnce to `PermissionKind`
|
// from a mere string to a reference to `PermissionKind`
|
||||||
permissions_obj.array().items.replace(
|
permissions_obj.array().items.replace(
|
||||||
Schema::Object(SchemaObject {
|
Schema::Object(SchemaObject {
|
||||||
reference: Some("#/definitions/PermissionKind".into()),
|
reference: Some("#/definitions/PermissionKind".into()),
|
||||||
|
|||||||
@@ -112,13 +112,13 @@ mod window_effects {
|
|||||||
UnderWindowBackground,
|
UnderWindowBackground,
|
||||||
/// **macOS 10.14+**
|
/// **macOS 10.14+**
|
||||||
UnderPageBackground,
|
UnderPageBackground,
|
||||||
/// Mica effect that matches the system dark perefence **Windows 11 Only**
|
/// Mica effect that matches the system dark preference **Windows 11 Only**
|
||||||
Mica,
|
Mica,
|
||||||
/// Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
|
/// Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
|
||||||
MicaDark,
|
MicaDark,
|
||||||
/// Mica effect with light mode **Windows 11 Only**
|
/// Mica effect with light mode **Windows 11 Only**
|
||||||
MicaLight,
|
MicaLight,
|
||||||
/// Tabbed effect that matches the system dark perefence **Windows 11 Only**
|
/// Tabbed effect that matches the system dark preference **Windows 11 Only**
|
||||||
Tabbed,
|
Tabbed,
|
||||||
/// Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
|
/// Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
|
||||||
TabbedDark,
|
TabbedDark,
|
||||||
@@ -372,7 +372,7 @@ pub enum Error {
|
|||||||
#[cfg(feature = "resources")]
|
#[cfg(feature = "resources")]
|
||||||
#[error("could not walk directory `{0}`, try changing `allow_walk` to true on the `ResourcePaths` constructor.")]
|
#[error("could not walk directory `{0}`, try changing `allow_walk` to true on the `ResourcePaths` constructor.")]
|
||||||
NotAllowedToWalkDir(std::path::PathBuf),
|
NotAllowedToWalkDir(std::path::PathBuf),
|
||||||
/// Resourece path doesn't exist
|
/// Resource path doesn't exist
|
||||||
#[cfg(feature = "resources")]
|
#[cfg(feature = "resources")]
|
||||||
#[error("resource path `{0}` doesn't exist")]
|
#[error("resource path `{0}` doesn't exist")]
|
||||||
ResourcePathNotFound(std::path::PathBuf),
|
ResourcePathNotFound(std::path::PathBuf),
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ fn resource_dir_from<P: AsRef<std::path::Path>>(
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cfg_attr(not(target_vendor = "apple"), link_section = ".taubndl")]
|
#[cfg_attr(not(target_vendor = "apple"), link_section = ".taubndl")]
|
||||||
#[cfg_attr(target_vendor = "apple", link_section = "__DATA,taubndl")]
|
#[cfg_attr(target_vendor = "apple", link_section = "__DATA,taubndl")]
|
||||||
// Marked as `mut` becuase it could get optimized away without it,
|
// Marked as `mut` because it could get optimized away without it,
|
||||||
// see https://github.com/tauri-apps/tauri/pull/13812
|
// see https://github.com/tauri-apps/tauri/pull/13812
|
||||||
static mut __TAURI_BUNDLE_TYPE: &str = "UNK";
|
static mut __TAURI_BUNDLE_TYPE: &str = "UNK";
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ impl ResourcePathsIter<'_> {
|
|||||||
|
|
||||||
fn next_current_path(&mut self) -> Option<crate::Result<Resource>> {
|
fn next_current_path(&mut self) -> Option<crate::Result<Resource>> {
|
||||||
// should be safe to unwrap since every call to `self.next_current_path()`
|
// should be safe to unwrap since every call to `self.next_current_path()`
|
||||||
// is preceeded with assignemt to `self.current_path`
|
// is preceded with assignment to `self.current_path`
|
||||||
let path = self.current_path.take().unwrap();
|
let path = self.current_path.take().unwrap();
|
||||||
|
|
||||||
let is_dir = path.is_dir();
|
let is_dir = path.is_dir();
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ dirs = "6"
|
|||||||
percent-encoding = "2"
|
percent-encoding = "2"
|
||||||
raw-window-handle = { version = "0.6", features = ["std"] }
|
raw-window-handle = { version = "0.6", features = ["std"] }
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
urlpattern = "0.3"
|
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
data-url = { version = "0.3", optional = true }
|
data-url = { version = "0.3", optional = true }
|
||||||
serialize-to-javascript = "0.1.2"
|
serialize-to-javascript = "0.1.2"
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ impl AppHandle<crate::Wry> {
|
|||||||
|
|
||||||
#[cfg(target_vendor = "apple")]
|
#[cfg(target_vendor = "apple")]
|
||||||
impl<R: Runtime> AppHandle<R> {
|
impl<R: Runtime> AppHandle<R> {
|
||||||
/// Fetches all Data Store Indentifiers by this app
|
/// Fetches all Data Store Identifiers by this app
|
||||||
///
|
///
|
||||||
/// Needs to be called from Main Thread
|
/// Needs to be called from Main Thread
|
||||||
pub async fn fetch_data_store_identifiers(&self) -> crate::Result<Vec<[u8; 16]>> {
|
pub async fn fetch_data_store_identifiers(&self) -> crate::Result<Vec<[u8; 16]>> {
|
||||||
@@ -513,7 +513,7 @@ impl<R: Runtime> AppHandle<R> {
|
|||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// let plugin = init_plugin();
|
/// let plugin = init_plugin();
|
||||||
/// // `.name()` requires the `PLugin` trait import
|
/// // `.name()` requires the `Plugin` trait import
|
||||||
/// let plugin_name = plugin.name();
|
/// let plugin_name = plugin.name();
|
||||||
/// tauri::Builder::default()
|
/// tauri::Builder::default()
|
||||||
/// .plugin(plugin)
|
/// .plugin(plugin)
|
||||||
@@ -1577,7 +1577,7 @@ impl<R: Runtime> Builder<R> {
|
|||||||
|
|
||||||
/// Append a custom initialization script.
|
/// Append a custom initialization script.
|
||||||
///
|
///
|
||||||
/// Allow to append custom initialization script instend of replacing entire invoke system.
|
/// Allow to append custom initialization script instead of replacing entire invoke system.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ impl<R: Runtime> InvokeResolver<R> {
|
|||||||
F: Future<Output = Result<InvokeResponseBody, InvokeError>> + Send + 'static,
|
F: Future<Output = Result<InvokeResponseBody, InvokeError>> + Send + 'static,
|
||||||
{
|
{
|
||||||
// Dynamic dispatch the call in dev for a faster compile time
|
// Dynamic dispatch the call in dev for a faster compile time
|
||||||
// TODO: Revisit this and see if we can do this for the release build as well if the performace hit is not a problem
|
// TODO: Revisit this and see if we can do this for the release build as well if the performance hit is not a problem
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
self.respond_async_serialized_dyn(Box::pin(task))
|
self.respond_async_serialized_dyn(Box::pin(task))
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ pub enum EventLoopMessage {
|
|||||||
|
|
||||||
/// The webview runtime interface. A wrapper around [`runtime::Runtime`] with the proper user event type associated.
|
/// The webview runtime interface. A wrapper around [`runtime::Runtime`] with the proper user event type associated.
|
||||||
pub trait Runtime: runtime::Runtime<EventLoopMessage> {}
|
pub trait Runtime: runtime::Runtime<EventLoopMessage> {}
|
||||||
/// The webview runtime handle. A wrapper arond [`runtime::RuntimeHandle`] with the proper user event type associated.
|
/// The webview runtime handle. A wrapper around [`runtime::RuntimeHandle`] with the proper user event type associated.
|
||||||
pub trait RuntimeHandle: runtime::RuntimeHandle<EventLoopMessage> {}
|
pub trait RuntimeHandle: runtime::RuntimeHandle<EventLoopMessage> {}
|
||||||
|
|
||||||
impl<W: runtime::Runtime<EventLoopMessage>> Runtime for W {}
|
impl<W: runtime::Runtime<EventLoopMessage>> Runtime for W {}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ impl<R: Runtime> AppManager<R> {
|
|||||||
crate::app::GlobalTrayIconEventListener<AppHandle<R>>,
|
crate::app::GlobalTrayIconEventListener<AppHandle<R>>,
|
||||||
>,
|
>,
|
||||||
window_event_listeners: Vec<GlobalWindowEventListener<R>>,
|
window_event_listeners: Vec<GlobalWindowEventListener<R>>,
|
||||||
webiew_event_listeners: Vec<GlobalWebviewEventListener<R>>,
|
webview_event_listeners: Vec<GlobalWebviewEventListener<R>>,
|
||||||
#[cfg(desktop)] window_menu_event_listeners: HashMap<
|
#[cfg(desktop)] window_menu_event_listeners: HashMap<
|
||||||
String,
|
String,
|
||||||
crate::app::GlobalMenuEventListener<Window<R>>,
|
crate::app::GlobalMenuEventListener<Window<R>>,
|
||||||
@@ -292,7 +292,7 @@ impl<R: Runtime> AppManager<R> {
|
|||||||
invoke_handler,
|
invoke_handler,
|
||||||
on_page_load,
|
on_page_load,
|
||||||
uri_scheme_protocols: Mutex::new(uri_scheme_protocols),
|
uri_scheme_protocols: Mutex::new(uri_scheme_protocols),
|
||||||
event_listeners: Arc::new(webiew_event_listeners),
|
event_listeners: Arc::new(webview_event_listeners),
|
||||||
invoke_initialization_script,
|
invoke_initialization_script,
|
||||||
invoke_key: invoke_key.clone(),
|
invoke_key: invoke_key.clone(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ pub trait Plugin<R: Runtime>: Send {
|
|||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn webview_created(&mut self, webview: Webview<R>) {}
|
fn webview_created(&mut self, webview: Webview<R>) {}
|
||||||
|
|
||||||
/// Callback invoked when webview tries to navigate to the given Url. Returning falses cancels navigation.
|
/// Callback invoked when webview tries to navigate to the given Url. Returning false cancels navigation.
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn on_navigation(&mut self, webview: &Webview<R>, url: &Url) -> bool {
|
fn on_navigation(&mut self, webview: &Webview<R>, url: &Url) -> bool {
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ impl From<tray_icon::MouseButton> for MouseButton {
|
|||||||
///
|
///
|
||||||
/// ## Platform-specific:
|
/// ## Platform-specific:
|
||||||
///
|
///
|
||||||
/// - **Linux**: Unsupported. The event is not emmited even though the icon is shown
|
/// - **Linux**: Unsupported. The event is not emitted even though the icon is shown
|
||||||
/// and will still show a context menu on right click.
|
/// and will still show a context menu on right click.
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
@@ -314,7 +314,7 @@ impl<R: Runtime> TrayIconBuilder<R> {
|
|||||||
/// - **Linux:** Unsupported.
|
/// - **Linux:** Unsupported.
|
||||||
#[deprecated(
|
#[deprecated(
|
||||||
since = "2.2.0",
|
since = "2.2.0",
|
||||||
note = "Use `TrayIconBuiler::show_menu_on_left_click` instead."
|
note = "Use `TrayIconBuilder::show_menu_on_left_click` instead."
|
||||||
)]
|
)]
|
||||||
pub fn menu_on_left_click(mut self, enable: bool) -> Self {
|
pub fn menu_on_left_click(mut self, enable: bool) -> Self {
|
||||||
self.inner = self.inner.with_menu_on_left_click(enable);
|
self.inner = self.inner.with_menu_on_left_click(enable);
|
||||||
|
|||||||
@@ -2068,7 +2068,7 @@ tauri::Builder::default()
|
|||||||
|
|
||||||
/// Specify the webview background color.
|
/// Specify the webview background color.
|
||||||
///
|
///
|
||||||
/// ## Platfrom-specific:
|
/// ## Platform-specific:
|
||||||
///
|
///
|
||||||
/// - **macOS / iOS**: Not implemented.
|
/// - **macOS / iOS**: Not implemented.
|
||||||
/// - **Windows**:
|
/// - **Windows**:
|
||||||
|
|||||||
@@ -2042,9 +2042,9 @@ impl<R: Runtime> WebviewWindow<R> {
|
|||||||
/// Sets this window's minimum inner width.
|
/// Sets this window's minimum inner width.
|
||||||
pub fn set_size_constraints(
|
pub fn set_size_constraints(
|
||||||
&self,
|
&self,
|
||||||
constriants: tauri_runtime::window::WindowSizeConstraints,
|
constraints: tauri_runtime::window::WindowSizeConstraints,
|
||||||
) -> crate::Result<()> {
|
) -> crate::Result<()> {
|
||||||
self.window.set_size_constraints(constriants)
|
self.window.set_size_constraints(constraints)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets this window's position.
|
/// Sets this window's position.
|
||||||
|
|||||||
@@ -1941,12 +1941,12 @@ tauri::Builder::default()
|
|||||||
/// Sets this window's minimum inner width.
|
/// Sets this window's minimum inner width.
|
||||||
pub fn set_size_constraints(
|
pub fn set_size_constraints(
|
||||||
&self,
|
&self,
|
||||||
constriants: tauri_runtime::window::WindowSizeConstraints,
|
constraints: tauri_runtime::window::WindowSizeConstraints,
|
||||||
) -> crate::Result<()> {
|
) -> crate::Result<()> {
|
||||||
self
|
self
|
||||||
.window
|
.window
|
||||||
.dispatcher
|
.dispatcher
|
||||||
.set_size_constraints(constriants)
|
.set_size_constraints(constraints)
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
) {
|
) {
|
||||||
// macOS maximization happens on `mouseup`,
|
// macOS maximization happens on `mouseup`,
|
||||||
// so we save needed state and early return
|
// so we save needed state and early return
|
||||||
if (osName === 'macos' && e.detail == 2) {
|
if (osName === 'macos' && e.detail === 2) {
|
||||||
initialX = e.clientX
|
initialX = e.clientX
|
||||||
initialY = e.clientY
|
initialY = e.clientY
|
||||||
return
|
return
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
window.__TAURI_INTERNALS__.invoke('plugin:window|' + cmd)
|
window.__TAURI_INTERNALS__.invoke('plugin:window|' + cmd)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// on macOS we maximze on mouseup instead, to match the system behavior where maximization can be canceled
|
// on macOS we maximize on mouseup instead, to match the system behavior where maximization can be canceled
|
||||||
// if the mouse moves outside the data-tauri-drag-region
|
// if the mouse moves outside the data-tauri-drag-region
|
||||||
if (osName === 'macos') {
|
if (osName === 'macos') {
|
||||||
document.addEventListener('mouseup', (e) => {
|
document.addEventListener('mouseup', (e) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { defineConfig, presetIcons, presetUno, presetWebFonts } from 'unocss'
|
import { defineConfig, presetIcons, presetWind3, presetWebFonts } from 'unocss'
|
||||||
import extractorSvelte from '@unocss/extractor-svelte'
|
import extractorSvelte from '@unocss/extractor-svelte'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -88,7 +88,7 @@ export default defineConfig({
|
|||||||
checkbox: 'accent-accent'
|
checkbox: 'accent-accent'
|
||||||
},
|
},
|
||||||
presets: [
|
presets: [
|
||||||
presetUno(),
|
presetWind3(),
|
||||||
presetIcons(),
|
presetIcons(),
|
||||||
presetWebFonts({
|
presetWebFonts({
|
||||||
fonts: {
|
fonts: {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ fn main() {
|
|||||||
|
|
||||||
// NOTICE: `args` may include URL protocol (`your-app-protocol://`)
|
// NOTICE: `args` may include URL protocol (`your-app-protocol://`)
|
||||||
// or arguments (`--`) if your app supports them.
|
// or arguments (`--`) if your app supports them.
|
||||||
// files may aslo be passed as `file://path/to/file`
|
// files may also be passed as `file://path/to/file`
|
||||||
for maybe_file in std::env::args().skip(1) {
|
for maybe_file in std::env::args().skip(1) {
|
||||||
// skip flags like -f or --flag
|
// skip flags like -f or --flag
|
||||||
if maybe_file.starts_with('-') {
|
if maybe_file.starts_with('-') {
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ function convertFileSrc(filePath: string, protocol = 'asset'): string {
|
|||||||
* A rust-backed resource stored through `tauri::Manager::resources_table` API.
|
* A rust-backed resource stored through `tauri::Manager::resources_table` API.
|
||||||
*
|
*
|
||||||
* The resource lives in the main process and does not exist
|
* The resource lives in the main process and does not exist
|
||||||
* in the Javascript world, and thus will not be cleaned up automatiacally
|
* in the Javascript world, and thus will not be cleaned up automatically
|
||||||
* except on application exit. If you want to clean it up early, call {@linkcode Resource.close}
|
* except on application exit. If you want to clean it up early, call {@linkcode Resource.close}
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class LogicalSize {
|
|||||||
*
|
*
|
||||||
* Physical pixels represent actual screen pixels, and are DPI-independent.
|
* Physical pixels represent actual screen pixels, and are DPI-independent.
|
||||||
* For high-DPI windows, this means that any point in the window on the screen
|
* For high-DPI windows, this means that any point in the window on the screen
|
||||||
* will have a different position in logical pixels (@linkcode LogicalSize).
|
* will have a different position in logical pixels {@linkcode LogicalSize}.
|
||||||
*
|
*
|
||||||
* For physical-pixel-based position, see {@linkcode PhysicalPosition}.
|
* For physical-pixel-based position, see {@linkcode PhysicalPosition}.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class WebviewWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen to an emitted event on this webivew window.
|
* Listen to an emitted event on this webview window.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```typescript
|
* ```typescript
|
||||||
|
|||||||
@@ -2229,7 +2229,7 @@ enum Effect {
|
|||||||
*/
|
*/
|
||||||
Acrylic = 'acrylic',
|
Acrylic = 'acrylic',
|
||||||
/**
|
/**
|
||||||
* Tabbed effect that matches the system dark perefence **Windows 11 Only**
|
* Tabbed effect that matches the system dark preference **Windows 11 Only**
|
||||||
*/
|
*/
|
||||||
Tabbed = 'tabbed',
|
Tabbed = 'tabbed',
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user